3 ms·
the moral of the story is avoid modes whenever possible We try to avoid using global state (and state in general) in software engineering for this exact same r
by shoyer 12y ago
the moral of the story is avoid modes whenever possible
We try to avoid using global state (and state in general) in software engineering for this exact same reason. Humans just aren't good at keeping track of more than a few things at once, even if they are the ones who designed the system in the first place.
- damian2000 12y agoThere's nothing at all wrong with state (i.e. variables) in programs - relatively few programs don't use state. The issue is with UI modes ... reusing the same UI which means two different things according to the mode its in.
- shoyer 12y agoBy "state in general", I particularly meant mutable or nonlocal state in general. There is obviously nothing wrong with using variables. To restate my analogy: the problem is when you can run the same function twice with the same input and get a different result. Or when the same variable can mean two totally different things depending on some external context.