What would you recommend as a best practice to separate production and development environments, but from the aspect of code itself.
Example: imagine application using Active Directory which should authenticate based only on the domain controller, without taking local users and group setting from windows into account. For production environment, code should ignore local users and groups so that security hole is avoided. For development environment (dev machines, build machines...), these local settings should be allowed for easier development / testing whatever (lets say setting up a domain controller for tests is somewhat expensive, and local group participation can be changes easily so that developers could test around different test cases).
The concrete example I have stated here is not important, the situation that could occur because of anything similar what should be enabled / disabled in the real production is important. And also, bear in mind that I am not talking about having different config files for the application, the setting for development environment should somehow be completely hidden from the customers because it would allow some very serious security problems).