by kazinator · 2y ago · 0 comments
This thing is just a counterpart to void that is a class. A better name would be voidclass or something along those lines.
(There is a Monostate pattern, but that involves a class with state: just all the state is static. It's basically like a module with global variables. Completely different thing.)
But in a way, this is right since:
<no of bits>
2 = <no of states>
When the number of bits is 0, 2^0 = 1: 1 state. A state machine with one state is certainly possible.Problem is we need 2 or more states to do anything useful with state. We can draw an initial state bubble in a state diagram and not add any states; it can even have transitions back to itself.
So maybe monostate is not exactly a misnomer; it's just weird to mention state about something that is not useful for working with state.