4 ms·
I'm not a branchless coding fanatic at all, but arguing for else-if with execution speed arguments isn't the way. Moreover, else-if is probably the most misuse
by orwin 2y ago
I'm not a branchless coding fanatic at all, but arguing for else-if with execution speed arguments isn't the way.
Moreover, else-if is probably the most misused conditional, so while I disagree that it shouldn't exist (it has some uses), GP has a point.
Although linters now are good enough now to catch poorly used conditionals, so his point is way less relevant than it was a decade ago.
- bayindirh 2y ago> but arguing for else-if with execution speed arguments isn't the way. Depends on the code base and problem domain you code / live in. In most cases you're right, but in my domain it's a different story. > Moreover, else-if is probably the most misused conditional You can misuse anything in any language, so by this logic we should argue that we shall abolish all programming altogether. I can misuse threads to make a program slower, misuse memory allocator to fragment the memory, etc. etc. So I don't think "but people misuse it" is a great argument either.