4 ms·
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. T
by nirvdrum 5y 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.
- debacle 5y agoIt's a readability optimization, not a performance optimization.
- CRConrad 5y agoWhat's wrong with readability optimizations, be they micro- or macro-?
- debacle 5y agoThe 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."
- CRConrad 5y agoDid 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?
- debacle 5y agoEveryone doesn't agree that this is bad for readability, and the status quo is the status quo for a reason.
- CRConrad 5y agoTwo, 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.