I work for a company that is building a web application with ASP.NET & MVC, which was last worked on a few months ago. I am part of the team working on the project and have encountered values (such as place names) being hard-coded in the project's web.config file.
In my opinion this is bad practice as multiple developers have different versions of the web.config so hard-coding values in this file would result in inconsistencies. Additionally, non-developers may need to add/remove values and have a higher chance of causing unstable behaviour if they accidentally break the web.config (as code cannot be compiled with errors such as missing quotes around strings, but such errors in the web.config may not be caught as they are seen as "valid").
The understanding of my colleagues is that hard-coding values in this way makes it easier for others to change these values, as opposed to maintaining a centralised class containing the values (of which any syntax errors will be caught).
The web.config can be modified on-the-fly without requiring re-compilation, whereas code changes require recompilation. Any changes to these values would be made when the web application is not in use and the deploy environment would automatically recompile before re-deploy anyway.
Am I correct that storing such values in the web configuration file for the application is bad practice?