Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I hate environment variables so much. They’re the source of so much pain and suffering.

I never write code that uses envvars. Always use cmdline args or a config file.

If I were designing an OS I’d do everything in my power to not have an envvar API. It’s probably not possible, but damnit I’d try



Environment variables are especially convenient IMO for parameterizing Docker images when running containers, e.g. using Docker or Kubernetes, etc.

Also, for configuring all sort of credentials for libraries, e.g. AWS, WandB, HuggingFace, etc.


I also hate Docker and think it only exists because modern design principles have failed. Reliably launching a software program shouldn't be difficult. But instead we've chosen to rely on a big ugly fragile ball of global system/environment state. And the only way to even launch a program is with heavyweight containers.

Running a computer program shouldn't require a Docker image. Which in turn alleviates the need to use gross environment variables.


I was about to comment something like, “you’re strange”, but then I remembered how I spent the last several nights debugging server issues that basically boiled down to badly set environment variables. I added code to the startup script to explicitly throw when the env variables are not set/empty, but this papers over a problem and just makes debugging easier. It doesn’t solve it.


Id like to hear more. I've also felt this way but have fallen back on them (plus been too scared to question the conventional wisdom).




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: