Best practices switching environments in software projects

One of the most important things when working on different environments (Development, Staging, Production, etc.) in the same software project, is to not confuse them.

The problem resides in the similarity the environments tend to have, when they are not identical. It is definitely not uncommon to have exactly the same thing deployed on similar machines but that have different responsibilities. For obvious purposes (i.e. testing), we do want them to behave in the most similar way possible.

One thing that helps me is to try to look at the distinct environments differently. For example, these are the colors I often see when I manage a production environment:

It is annoying to see so much red, but that reminds me that I shouldn't work too much time on a live machine. Because a typo there could have immediate consequences.

The screenshots above and below are from the application WinSCP, a free SFTP client for Windows that, a part of having other features, allows you to attach different colors to sessions. The color is also visible on the session selection screen:

Putty, and its improved fork Kitty, allow to do the same thing for SSH:

Now that I'm looking at the Kitty website, I see that it even supports to have a different icon for each session. It may help.

When I started to work at my current employer, a coworker showed me a very interesting module for Drupal, Environment Indicator.