Preferably written in assembler, to avoid the extra complexity of a compiler, right?
Configuration files have been a common feature of software since OSs exist, basically. They serve a clear and useful purpose, even though they create some problems of their own.
For complex environments like those discussed in the article, there’s unavoidably complicated logic.
Code is a good place for logic to live.
Compared to yaml, code is more testable, readable and expressible.
I should’ve restricted my original comment to the kind of situation in the article where different configs are created for various regions and test environments with optional values. Totally agree configs are useful for defining more static values.
Restricting config to static values removes quite a bit of the value of config, in my opinion.
Yes, logic should live in code, but very often that logic needs to behave differently depending on some piece of (inherently variable, not static) configuration.
Random examples (written from the perspective of personified code):
- How many threads should I use?
- On which port should I serve metrics?
- Which retry strategy should I use?
By "more static", I meant items with only a handful of variations.
If you're using one port for dev & another for prod I reckon it's best to have it in config.
But if you're port is varying by image, region, dev/test/prod status and has exceptions for customers using your app on prem then keeping all that logic in code may be easier.
Configuration files have been a common feature of software since OSs exist, basically. They serve a clear and useful purpose, even though they create some problems of their own.