2 ms·
> What if you, one day, want multiple worlds for some reason? Write code for the application you want, not the set of all applications you might hypothetically
by JimDabell 8y ago
> What if you, one day, want multiple worlds for some reason?
Write code for the application you want, not the set of all applications you might hypothetically want someday. Incur the cost of new features after you decide you want them, not before.
- mpartel 8y agoIn general I fully agree, YAGNI and all that, but from experience, mutable globals, unless used very sparingly, rigidify the codebase to a surprising degree and make it more error-prone, often for very little actual gain. As with any software engineering guideline, there are exceptions. E.g. Java-style loggers are so ubiqitous and "not that mutable", that it's generally good for them to be global. Edit: also from experience, suddenly wanting two of something where before there was only one, is not that uncommon.
- AstralStorm 8y agoGlobal state is a maintenance cost from day 1, increasing over time.