Hacker News new | ask | show | jobs
by Galanwe 1270 days ago
The problem with environment variables as configuration is that it's unstructured, hardly documented, and overall hard to reproduce and inspect.

Nothing is worse than trying to understand an issue with a program that heavily relies on environment variables for configuration, as environment variables are designed to be short-lived, memory only.

A good old configuration file is the best. You can version it, distribute it, it's explicit, possibly structured, easily documented.

That doesn't mean that there is no room for environment variables, but these should be for local-only hacks and tweaks.

1 comments

> Nothing is worse than trying to understand an issue with a program that heavily relies on environment variables for configuration

I totally agree with this.

> A good old configuration file is the best.

But the issue with this is that you often don't know what your configuration is ahead of time. Sometimes it is only generated just before execution of your code.