3 ms·
Please if you are in this situation do not take this advice. You just generate massive garbage abstractions upstream. If boolean arguments are out of hand, the
by baw-bag 1y ago
Please if you are in this situation do not take this advice. You just generate massive garbage abstractions upstream. If boolean arguments are out of hand, the problem isn't the boolean.
- nurettin 1y agoIsn't that the point? If booleans are out of hand, either you are trying to emulate a state machine or you are lacking enums. Or in case of 20 bool parameters, just make it a struct. Nobody will complain.
- astrange 1y agoEveryone's always trying to emulate a state machine - OOP objects are kind of just an unsafe informal state machine implementation. Oddly, almost noone has tried providing actual state machines where you have to prove you've figured out what the state transitions are.