this post was submitted on 10 Apr 2024
108 points (95.8% liked)
Programming
17457 readers
87 users here now
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities [email protected]
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Not sure I buy this. If you have a config header file and make backwards incompatible changes to it how is that different to having backwards incompatible changes to any other config system?
I think what the author meant to say is "don't make breaking changes to your config system". Maybe it's common to ignore that when using source code as config; I don't know.
It's a bad idea anyway because compile-time options should generally only be for configuring the presence of optional third party dependencies, which you can do automatically. Anything else should be a runtime option.
I think the author's primary point is, "Merging changes sucks, don't make your users do that," with a corollary: if your program loads configuration from a directory that is only populated by the user, there's nothing to merge and thus never any merge conflicts. Case in point:
/etc/polkit-1/rules.d
. I can add whatever rules files I want in there and they're never going to conflict when I update. If PolKit makes breaking changes to the format, it will log errors somewhere and I can look at those errors, look at my rules, and figure out how to fix them. That's a hell of a lot easier than merging conflicting changes to code/configuration.That's totally orthogonal to whether your config is source code or not though.
True, but if you read the article the point is clearly not about source code vs non-source configuration. There's an implicit assumption that source code is something the developer will be modifying as time goes on, but the real point is, "Don't make users merge changes."