Sometimes, the elegant implementation is just a global variable. Not a method. Not a class. Not a singleton. Not a dependency injection framework. Just a global variable.
Conversation
Notices
-
Embed this notice
Niki Tonsky (nikitonsky@mastodon.online)'s status on Wednesday, 11-Jun-2025 20:01:55 JST
Niki Tonsky
-
Embed this notice
Niki Tonsky (nikitonsky@mastodon.online)'s status on Wednesday, 11-Jun-2025 21:52:06 JST
Niki Tonsky
@ahelwer I’m more afraid of people who put (randomly acquired) principles over common sense. Who says all global variables are always bad? What if code with a global variable is shorter, simpler, more straightforward? You’d still think it’s bad? Why?
-
Embed this notice
Andrew Helwer (ahelwer@discuss.systems)'s status on Wednesday, 11-Jun-2025 21:52:07 JST
Andrew Helwer
@nikitonsky I pray I never encounter this lol. I visualize accepting I need to make a global variable as having the same energy as, like, an idealistic politician realizing they need to jettison their values once acquiring power or something
-
Embed this notice