4 ms·
I have only very rarely used environment variables in my own software over the last 20 years. The argument for their use that I have heard the most frequently h
by victorNicollet 6y ago
I have only very rarely used environment variables in my own software over the last 20 years. The argument for their use that I have heard the most frequently has been "you would have to be an idiot to not use them" which has thus far failed to convince me. That, and its little brother "you must never have pushed anything to production" seem to find some echo in this thread.
From what I could gather, the actual reasons that Other People use environment variables seem to be:
- Other People use some tool for a reason unrelated to environment variables, and that tool happens to make environment variables extremely easy or convenient. A more pessimistic alternative: that tool makes everything inconvenient except for environment variables. Whatever that tool may be, I suspect that I am not using it.
- Other People write programs that are invoked (I write programs that run continuously), and environment variables improve the ease with which programs can be invoked, which is a concept I never have to deal with.
My programs load their configuration from files at startup ; configuration files are committed to git and included in the build ; secrets live in a remote key vault, with a local cache in case of unavailability. Maybe in the future, I will discover something that environment variables greatly improve about this. I don't know.