Hacker News new | ask | show | jobs
by nirvdrum 1740 days ago
Could you please elaborate? To me, it looks like the article posits using boolean flags instead of enums is a code legibility issue, not a performance matter. There may still be good reason to reject a large PR such as the one you described. But, I don't get where the micro-optimization appears.
1 comments

It's a readability optimization, not a performance optimization.
What's wrong with readability optimizations, be they micro- or macro-?
The next person to read that isn't going to say "Wow this is so clever." They are going to say "Wow this guy didn't know about booleans."
Did you just skip over the beginning of the discussion, where everyone agreed that having a bunch of anonymous booleans is bad for readability, and circle back to advocating the status quo that everyone else is trying to improve on?
Everyone doesn't agree that this is bad for readability, and the status quo is the status quo for a reason.
Two, even. Two reasons:

1) Too many languages don't have native enumeration and set types to make a clean and elegant solution even possible.

2) Too many developers don't know how to do it, even if they use a language where it would be possible; some because they couldn't figure it out, but most probably just out of rote habit.

And yeah, sure, not quite everyone. But most, AFAICS. And I haven't seen any coherent argument against it from anyone actively claiming it's bad (Idunno, are there any besides you?), so feel free to try again and contribute something more convincing than your previous attempt.