3 ms·
I Like and Use Global Variables, then I grew up. ;-)
by progx 2y ago
I Like and Use Global Variables, then I grew up. ;-)
- Cthulhu_ 2y agoSo did I, and then I did a stint in pico-8, stopped worrying and started loving the globals. It's my code, tiny, sloppy, single threaded, nobody reads it, it just needs to do a job. Not going to use it in anything I get paid for though, lol. At one point there was a commonly accepted "singleton" pattern for things like logging but that's just globals with extra steps. In Go I just create services in my main and pass them around where needed.
- flohofwoe 2y agoI liked and used global variables, then I grew up and never used them, then I got more experienced and started to use them again in places where it makes sense ;) (same with goto btw)