Hacker News new | ask | show | jobs
by pavlov 4126 days ago
... most self-respecting developers have got rid of mutable global variables in their code long ago.

I'm not convinced that's the case. Almost everyone has merely hidden their mutable globals under layers of abstractions. Things like "singletons", "factories", "controllers", "service objects", "dependency injection" are the vernacular of the masked-globals game.

1 comments

None of those things you said imply mutability. (Okay, maybe singletons, depending on the implementation.)
True, but in practice they tend to be used as containers or initializers for mutable variables.