Alright, let’s get down to brass tacks. You’ve probably heard of the “12-Factor App” methodology. Some of it is brilliant, some is a bit preachy, but its third factor, Config, is non-negotiable for any application that plans to breathe in multiple environments (dev, staging, production, your laptop, etc.). The principle is simple, yet constantly violated: strictly separate config from code.
Why? Because code is, ideally, immutable. The same build artifact should be promoted from stage to prod. Config, on the other hand, is everything that changes between those environments: database URLs, API keys, feature flags, the number of worker processes. If you bake config into your code, you’re essentially building a different application for each environment. That’s a nightmare for reproducibility and a security leak waiting to happen (hello, hardcoded prod credentials in your dev codebase).