News for hackers. Stuff that matters.
Re:It's not what programming languages do, it's what they sh... by p_l on Friday March 27, 2020 @03:44PM (#22706120)
one example of good use of globals is for very light-weight pub/sub, where you keep the rule that only one place can write to the global (preferably with something like atomic write) and any other place only reads.
Re:It's not what programming languages do, it's what they sh... by DubiousPusher on Tuesday March 31, 2020 @08:05PM (#22744221)
I use this kind of blackboard system still when I can't avoid globals. The main thing it helps with I find is you still have to know the order of and when your systems are being setup.

Ran into so many bugs from people creating static instance globals and thinking it was good that they didn't have to care when systems were setup.

I hate create on access with a passion. For god sake just new the damn thing at the beginning of main if nowhen else.