Hacker News new | ask | show | jobs
by nurettin 299 days ago
Isn'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.
1 comments

Everyone'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.