Should architects make their applications aware of whether they are production or not?
Bogopo last edited by
I work with an application that can be heavily customized. In many cases for a Greenfield development, the developers and architects will decide to put in place an API that returns what environment you are currently in - usually by introspection looking at the database name but for the sake of this discussion let's avoid any pros or cons related to a specific implementation. Your results might be "Prod" which has special significance, "Test 1" which we then know has special capabilities to interface with other external systems, and "Dev 1" which is relatively not-special.
What I am wondering is if this is a good practice, a judgement call, or a bad practice.
The most obvious pro to me is that it can help automate certain nonproduction refresh tasks without deployment risk. The drawback is that we may frequently find ourselves in a place where testing is not touching code paths that will be taken in prod.
If a developer, tester or architect has a need to see the difference between an environment then adding something like this seems fine. Don't add it because you can, but only because you really need it.
Personally I would make sure the URL shows which environment it is.