3 ms·
For web servers, everything you say is true. I spent years writing desktop applications, and the config file was part of the whole application bootstrap proces
by marcus_holmes 10y ago
For web servers, everything you say is true.
I spent years writing desktop applications, and the config file was part of the whole application bootstrap process. It couldn't connect to the database until it knew where that was, and that entirely depended on the deployment environment.
Using environment variables basically meant that bits of the application's config lived in whatever environment system the OS used. It was possible, but massively more painful than shipping a text file with the application.
Creating a new executable for each customer install, with the config values hard-coded, was not an option, regardless of how fast it compiled. Keeping a copy of the text config files (in case there was a problem) was easy, but rarely done. Usually we talked the customer through emailing us a copy of their config file if there was a problem.
This kind of attitude persists. I still find myself hiving off any config into a separate part of the code base, with the knowledge that at some point I'm going to have to deal with that being serialised from a file. Even if it's a single-deploy web server. I think it's a good habit ;)