Why people dislike global variables so much while I find them so convenient?

rempas rempas at tutanota.com
Tue Jan 25 11:45:57 UTC 2022


On Tuesday, 25 January 2022 at 10:54:59 UTC, forkit wrote:
> If a computational path requires the use of a global variable, 
> then use it.
>
> What will mess you up, is not the global variable, but whether 
> you know - for certain - the computational path(s) that use 
> that global, and what effect those paths may have on that 
> global.
>
> It's pretty straight forward ;-)

Thanks! Actually, that's exactly how I see it. I only want to use 
them when necessary. Also it seems that they can be dangerous 
only when used in libraries and when other people can modify them 
(when they shouldn't) but I was mostly talking about 
applications...


More information about the Digitalmars-d mailing list