News for hackers. Stuff that matters.
Re:Don’t use environment variables for configuration by gnulinux on Thursday April 01, 2021 @12:45PM (#26662896)
I don't get this. From the same perspective you can argue global variables have scope too since they are "scoped to the current process". It's not like other processes can access your global variable, that's a very low bar for a scope.
Re:Don’t use environment variables for configuration by TrueDuality on Thursday April 01, 2021 @01:04PM (#26663216)
The difference here is that a running shell (including the shell environments that services run with in) are an abstraction layer about managing processes. Within that abstraction layer, each process can have its own unique environment variables that they can change and manipulate independently. That makes them not global.

Within a process the top level abstraction is the process itself, and anything underneath (class, method, function) will be impacted if another sub-abstraction makes a change to a global variable.

Re:Don’t use environment variables for configuration by gnulinux on Thursday April 01, 2021 @01:56PM (#26663899)
Makes sense, thanks.
Re:Don’t use environment variables for configuration by amelius on Thursday April 01, 2021 @05:33PM (#26666368)
> It's not like other processes can access your global variable, that's a very low bar for a scope.

They can read them, in /proc/[PID]/environ