Skip to main content

Timeline for Why is Global State so Evil?

Current License: CC BY-SA 3.0

45 events
when toggle format what by license comment
Feb 9, 2024 at 22:53 answer added gnasher729 timeline score: 1
Nov 24, 2023 at 1:28 comment added MikeSchinkel @whyer — No, his statement is not dogma itself. The Paradox of Tolerance explains why it is not: en.wikipedia.org/wiki/Paradox_of_tolerance
Nov 24, 2023 at 1:26 comment added MikeSchinkel @PieterB — Bravo! Absolutely.
May 2, 2022 at 9:30 review Suggested edits
May 9, 2022 at 22:59
Jul 15, 2021 at 11:21 comment added Stack Exchange Broke The Law @Madara'sGhost Yes, singletons are just globals and therefore, also evil. It's a shame it took the software industry so long to figure that out.
Dec 25, 2019 at 18:26 comment added whyer @PieterB isn't your statement "The only real evil are dogmas." - a dogma itself? hmm... is it evil too?
Feb 6, 2019 at 0:44 comment added underscore_d @ziGi Global constant data is considered a different thing, and I don't recall seeing anyone complaining about that, as opposed to an internet full of people advising against mutable global state. (That's not to say that even constants 'have' to be global, if anyone would otherwise abuse globals for constants that aren't really related but just 'happen' to have the same value... but I doubt that's a very realistic scenario in practice.)
Oct 6, 2017 at 7:30 comment added ziGi @Pacerier I am not expert but I would say that if it's immutable then you shouldn't have any problems since it is a preset global source of truth of some kind. Although I can't think of that many cases, if you compare it with the toothbrush example, this is like having a locked toothpaste dispenser. The paste is there for anyone to use but noone can replace it with soap, right?
Sep 19, 2017 at 17:57 comment added Pacerier @ziGi, What about immutable globals?
Jun 30, 2017 at 12:02 answer added Martin Ba timeline score: 7
May 24, 2016 at 17:54 comment added Andrew Even immutable global state can be changed by a programmer when requirements change. I like to be able to see what effects a change will make before I make it, which means reading all of the code that depends on what I'm changing. If I change a local variable, I read the whole function. If I change a private variable, I read the whole class. If I change that global system folder path, I'm out of luck unless I have time to read the entire program.
May 24, 2016 at 13:22 history edited gnat
edited tags
Mar 2, 2016 at 16:38 comment added Madara's Ghost @annoying_squid Please read the first sentence of the question :)
Mar 2, 2016 at 16:37 comment added annoying_squid The devil is evil. Global state is neither evil or good. It can very useful or harmful depending on how you use it. Don't listen to others and just learn how to program properly.
Sep 22, 2015 at 13:30 history protected gnat
May 15, 2015 at 14:20 comment added ziGi Using global state with your fellow programmers is like using the same toothbrush with your friends - you can but you never know when someone will decide to shove it up his bum.
Apr 23, 2014 at 11:30 history wiki removed maple_shaft
Mar 22, 2014 at 12:51 answer added luke1985 timeline score: 2
Sep 29, 2013 at 18:27 comment added Dexters @MadaraUchiha There is an excellent google tech talk - youtube.com/watch?v=-FRm3VPhseI
May 17, 2012 at 19:21 answer added Mike Samuel timeline score: 2
May 11, 2012 at 17:11 answer added phkahler timeline score: 3
May 11, 2012 at 16:11 answer added guillaume31 timeline score: 3
May 11, 2012 at 12:48 answer added KingOfHypocrites timeline score: 10
May 11, 2012 at 12:19 answer added jmoreno timeline score: 1
May 11, 2012 at 6:49 comment added Pieter B The only real evil are dogmas.
May 11, 2012 at 6:45 answer added Andrew Shepherd timeline score: 11
May 11, 2012 at 6:22 comment added Andrew Shepherd Also see this discussion: stackoverflow.com/questions/1392315/…
May 11, 2012 at 5:15 history tweeted twitter.com/#!/StackProgrammer/status/200816293753012226
May 11, 2012 at 2:50 answer added anon timeline score: 2
May 11, 2012 at 1:54 comment added Wyatt Barnett Mutable global state is bad. Very, very bad -- who can you trust to make the mutations? Immutable global state isn't great if it penetrates too deep into a codebase but can be an OK thing in general.
May 11, 2012 at 1:45 answer added James Anderson timeline score: 4
May 11, 2012 at 1:18 answer added mikera timeline score: 180
May 10, 2012 at 21:55 answer added RalphChapin timeline score: 2
May 10, 2012 at 20:12 comment added Job "for instance system folder paths, or application-wide database credentials ..." storing credentials is a separate topic, but if the settings are read-only, and I mean read-only, then this is fine. In fact, Visual Studio lets you generate settings that are global to the application. if the settings can change, then that is a totally different story .... by the way, dependency injection is an OOP concept. To truly understand why global state is evil, you need to drink some functional koolaid. I recommend pragmatic sources, such as SICP or some Clojure lectures.
May 10, 2012 at 20:02 answer added user53141 timeline score: 3
May 10, 2012 at 19:53 vote accept Madara's Ghost
May 10, 2012 at 19:53 history edited Madara's Ghost CC BY-SA 3.0
added 48 characters in body
May 10, 2012 at 19:47 answer added orourkek timeline score: 10
May 10, 2012 at 19:42 answer added sleske timeline score: 37
May 10, 2012 at 19:42 answer added DeadMG timeline score: 70
May 10, 2012 at 19:40 comment added Hajo you can also have a config object factory or config proxy object, its up to you how this is done. it makes you able to seperate configuration stuff from other parts.
May 10, 2012 at 19:39 comment added Madara's Ghost Where's the difference with using a global? Your "one and only one place" sounds very suspiciously like a Singleton.
May 10, 2012 at 19:37 comment added Hajo you can use a config class that handles access to those settings. i think its good practise to have one and only one place where configuration settings are read from config files and / or databases while other objects fetch them from that config thing. it makes your design more clean and predictable.
May 10, 2012 at 19:37 answer added GordonM timeline score: 361
May 10, 2012 at 19:35 history asked Madara's Ghost CC BY-SA 3.0