Hacker News new | ask | show | jobs
Configuration files suck. Just use a programming language (medium.com)
2 points by xvirk 3385 days ago
1 comments

No, please don't. Configuration file should be declarative and passive. You should be able to generate and load such file from any other language (for reporting, for detecting what things are configured, stuff like that). Programming language embedded in a configuration file makes the config unreadable.
> Configuration file should be declarative and passive.

It is very convenient - and sometimes absolutely necessary - to allow people to put their logic into configuration. Things like if dev_env: debug = true else debug = false. Or whatever else they might need there. Without that, you are forcing users to use something outside of your config files to generate that logic. The best approach depends on usecase.

> It is very convenient - and sometimes absolutely necessary - to allow people to put their logic into configuration.

It sometimes is somewhat convenient and quite often it's PITA. Indeed there are times when the code is a part of the configuration (Riemann is one such example, my two RPC daemons are another), but those are rare.

And then, most probably the pluggable logic should not be written in the same language as the software was implemented in.