On 19/05/2015 18:38, Andrey Semashev wrote:
On Tue, May 19, 2015 at 2:27 AM, Gavin Lambert wrote:
They're more popular in POSIX; but at least on Windows, environment variables are considered old-fashioned and discouraged from use without significant compelling reason.
Is there a reference for such a discouragement? Sure, most Windows-only programs just use registry but I wouldn't say environment variables are discouraged from being used. For instance, most development software, including MSVC, use environment for configuration, and registry is not seen as a replacement.
There's a distinction between command line and GUI tools. Environment variables are more likely to be used by command line tools, as they tend to be more script-friendly. It's rarer for environment variables to be used by GUI tools, and it's discouraged for a GUI tool to add itself to the global PATH on install, for example. (Even command line tools are encouraged to make shortcuts or scripts that temporarily add themselves to the PATH or set other variables for a particular command line session, rather than doing so globally.)