The one constant in software development is the knowledge that everything is subject to change. This is why I felt uneasy when I ran across a method that hard-coded the name of the production server. The code was testing the name of the server to see if it should display the database name directly (like we do during development) or whether it should just use a simple string like the name "Production". To do that, it checked the server name against a string literal in the method. The problem is that the server name is subject to change. If it does, you don't want to be forced to deploy a new version of the code. It's better to store some record in the database to indicate whether it's the production database or not. However you do it, hard-coding names into your system isn't usually a very good idea.
Download