this post was submitted on 06 Jul 2025
18 points (100.0% liked)
programming
258 readers
3 users here now
-
Post about programming, interesting repos, learning to program, etc. Let's try to keep free software posts in the c/libre comm unless the post is about the programming/is to the repo.
-
Do not doxx yourself by posting a repo that is yours and in any way leads to your personally identifying information. Use reports if necessary to alert mods to a potential doxxing.
-
Be kind, keep struggle sessions focused on the topic of programming.
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Not a fan of them. Depends on the language I guess but if Im using a heavily object or functional language it feels dirty to stuff globals somewhere.
It feels like a sequential programming paradigm which just doesn't fit the structure of most languages I use nowadays.
I still like having my state clearly defined somewhere if necessary. Always declare them at the top of the main file and clearly document them if you need to use them though.
That can end up being painful for some use cases, because you then have to manage the lifecycle of that global state directly, and you risk weird bugs from mismanaging that state.
But that's from my perspective with application development, where your single point of truth is usually some remote database. You just end up with a bunch of ephemeral and persistent state that aren't intuitive when using a global state pattern.
That sort of pattern you describe is still pretty much ideal for other domains, IMO. Flutter/dart (my primary language) are just not suited it!
I use Python pretty heavily and global state there is pretty rock solid thanks to the GIL, I also work primarily on single system local programs where I don't have to worry about syncing anything over the network.