Configuration files suck. Just use a programming language
1–4 of 4 posts
Re: Configuration files suck. Just use a programming language
#2Re: Configuration files suck. Just use a programming language
#3No, 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.
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.
Re: Configuration files suck. Just use a programming language
#4No, 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 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.