4 ms·
>The main reason config files exist is so you can edit the program without recompiling This isn't generally the reason. The main reason config files exist is s
by hoorayimhelping 7y ago
>The main reason config files exist is so you can edit the program without recompiling
This isn't generally the reason. The main reason config files exist is so you can run the program in in a different state easily. State differs across environments, code should not. This is why you have a config file for prod and test and dev, but you shouldn't have different code for prod and test and dev. You still have to rebuild the app for those environments. See: https://12factor.net/config https://12factor.net/config.
- macromaniac 7y ago>This isn't generally the reason. The main reason config files exist is so you can run the program in in a different state easily My ide lets me f12 to my config.js file and i can use editor hotkeys like comment toggle so by this metric my method is superior. >You still have to rebuild the app for those environments. As i said above you dont have to rebuild for python and javascript since they can load the config file on the fly. I use xml or json for compiled languages because beign able to change the program without recompiling is of critical importance. >you shouldn't have different code for prod and test and dev. You dont have different file for test/dev/prod, you have 1 config file that has a few inline if statments based off of runtime args. For me 1 file is less confusing than 2 or 3.