13 ms·
After using Rust for many years now, I feel that a mutable global variable is the perfect example of a "you were so busy figuring out whether you could, you nev
by michaelscott 10mo ago
After using Rust for many years now, I feel that a mutable global variable is the perfect example of a "you were so busy figuring out whether you could, you never stopped to consider whether you should".
Moving back to a language that does this kind of thing all the time now, it seems like insanity to me wrt safety in execution
- hu3 10mo agoGlobal mutable state is like a rite of passage for devs. Novices start slapping global variables everywhere because it makes things easy and it works, until it doesn't and some behaviour breaks because... I don't even know what broke it. On a smaller scale, mutable date handling libraries also provide some memorable WTF debugging moments until one learns (hopefully) that adding 10 days to a date should probably return a new date instance in most cases.
- port11 10mo agoHey, don't tell that to front-end developers, we like our global stores accessible all over.
- iLemming 10mo agoIt's because of the "status quo". Once you start using immutable-first language on the front-end, e.g., Clojurescript - your perspective changes.
- port11 10mo agoI know. I'm mostly gone from FE, the amount of cargo culting and “we do things that way because that's how it's always been” is toxic.
- ClayShentrup 10mo agoit's the classic Rich hickey talk. simple made easy.