3 ms·
About the use of mark up language as config file. I see that in most Python apps, the config file is just another Python script and not using another markup lan
by jemeshsu 14y ago
About the use of mark up language as config file. I see that in most Python apps, the config file is just another Python script and not using another markup language. This way makes sence in a dynamic language and it feels natural. I understand it is a habit to use yaml in Ruby apps for config. Is it not possible to just use Ruby script as config file since the script can be loaded dynamically? What are the pros and cons of using another markup language as config file vs using just the app language(Python/Ruby)?
- mccolin 14y agoIt is also common for ruby configs to be script files. Rails, for instance, has the config/initializers folder which is a set of ruby scripts that will be run at startup. It comes down mostly to preference.
- gavinballard 14y agoYour configuration file might need to be read by more than one language. It's also nice to have a configuration file mean the same thing regardless of its runtime environment.
- tartley 14y agoUsing script files to store config is convenient, but is it true that in some circumstances it could give malicious parties a chance to inject arbitrary executed code into your environment, in ways that parsing a pure data file could not.
- regularfry 14y agoDynamic config files are wrong for the same reason you don't want logic in your HTML templates.