Environment variables seem trivial until a secret lands in the repo, a deploy fails on a missing var, or staging and production quietly diverge. Three small habits prevent all of it.
First: a `.env.example` in the repo, listing every variable with a safe placeholder. It's the spec for what the app needs, and it makes onboarding a copy-paste instead of a scavenger hunt.
Second: validate at boot. If a required variable is missing, fail fast with a clear message, not a cryptic error three requests in. Third: never commit real secrets. The example file documents the shape; the values live in the environment, nowhere else.