3 ms·
I strongly agree. Often times environmental variables are used inappropriately and make tracking down issues harder due to loss of transparency. Plus environm
by Someone1234 12y ago
I strongly agree.
Often times environmental variables are used inappropriately and make tracking down issues harder due to loss of transparency.
Plus environmental variables are context specific (e.g. user 1 and user 2 might have different ones, or server 1 and server 2 might, or this specific script may have re-defined one(!)).
A good o' fashioned script with the constants defined at the top, commented, and passed into executables on the command line (so tools like ps or taskman can "see" them) is really easy to debug/alter/monitor.
Java and or Oracle's obsession with environmental variables causes more problems than it solves.
- realusername 12y agoI also agree, the only way I would use environment variables is for global configuration like HTTP_PROXY for example, otherwise I still prefer arguments, at least there is no surprises.
- philsnow 12y agoI was sad when I learned about this http_proxy environment variable and that things were actually starting to use it. An http proxy setting is no more suited for an environment variable than anything else. I think it should just be a string in a file in $XDG_CONFIG_DIR/http_proxy.conf or something like that.
- mitchty 12y agoI agree but I also use DEBUG in my scripts to allow for on the fly debugging to occur. I consider it a degenerate case and its only there for my own use and abuse. All it really does is redefines certain functions to be more verbose or print out debug level information. I had one script that let you do DEBUG=somefunc and it would instrument just that one function. But to be honest it was overkill.