That's the solution that I adhere to. But on a team with several devs, how do you prevent that from happening? Or how do you prevent yourself from accidentally(!) doing so (i.e. during the late-night coding sessions)?
If you never put credentials in your code, then even during panic mode you won't do it.