This thought crossed my mind the other day: in order to understand what is happening with a particular program, looking at the code won’t always tell you everything you need to know. It’s a good start, but without examining the environment that the code is running in, you may be missing some critical details.
When I say the environment the code is running in, I mean things like:
- External library version numbers
- Environment variables
- The current system time (and time zone)
- Network conditions (latency, packet loss, bandwidth)
- Existing data
In my software development experience, there’s been multiple occasions when the code has looked correct, but things were still running incorrectly as a result of something other than the code.
Remember: if the code looks correct, but results aren’t: check your environment.