4 ms·
One thing the article misses is that configuration files are often not only supposed to be machine readable, but also machine writable. Often, software offers
by jakobegger 8y ago
One thing the article misses is that configuration files are often not only supposed to be machine readable, but also machine writable.
Often, software offers commands to adjust config parameters (eg. PostgreSQL's ALTER SYSTEM command) or even a GUI interface for changing the configuration.
In these cases, if your config file format supports comments, or like the author suggests, even arbitrary code, then it's unlikely the software can automatically alter the config file. And even if it could, comments would quickly become outdated.
PostgreSQL addresses this issue by using multiple config files that can override each other, which can make debugging very hard, if you're not aware of the fact.
Issues like this can be avoided if you have a declarative config format like JSON, and the lack of comments actually becomes an advantage.
So in my opinion, if your config files can be changed by software, JSON is actually a very good option.
- Carpetsmoker 8y ago> configuration files are often not only supposed to be machine readable, but also machine writable. Config files which are expected to be written by both humans and machines are a fairly rare use case. Most config files are either editable by hand (e.g. /etc/), or editable though an UI (e.g. Firefox), but not both.