An interesting read, although I don’t necessarily agree with the premise.
Firstly, not all languages support a primitive enum
type(go, for one example). While you could make a “poor man’s” enum using maps, you lose some of the readability, type safety, and performance associated with primitives vs runtime-evaluated objects like maps. In that case you’re better off using multiple booleans.
Secondly, I would argue that the scenario presented in the article isn’t necessarily an argument for using an enum but rather an argument against poor design. It shouldn’t matter if a user is blocked and not online as those two states aren’t dependent of each other, only online and expired. Secondly, using a single function to define the total user state make future readability harder and violates the “do one thing” principle for functions. Each of those states should be broken into their component functions and called separately. That being said, this is just my opinion.
Keep up the good work!