Hacker News new | ask | show | jobs
by debacle 1740 days ago
If someone submitted a PR where all of their boolean parameters were actually enums I would reject it, open a PR of my own from the same branch, and reject that one too.

These clever micro-optimizations are a pathology of bored, well-meaning developers.

1 comments

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