3 ms·
Yep I'm dumb. That's what I get for writing that snippet last night with a few drinks in me. As for comparison against switches, I find that switches are very
by jacoblambda 7y ago
Yep I'm dumb. That's what I get for writing that snippet last night with a few drinks in me.
As for comparison against switches, I find that switches are very limited in a lot of languages (looking at you C/C++). The problem with the if else chain as well is that most code formatters seem to blow it up into the fully expanded form which kills readability.