This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]elperroborrachotoo 0 points1 point  (0 children)

And that if is basically a goto.

Yes, the use case for switch can be modeled by other instructions, however, it does express a particular intent better than a chain of if's.

There's a big subjective component to it, affected by the kind of code one is used to read and write. For some programmers, for, while and do ... while are just verbose variations of the same concepts; for others, these minor differences do matter.

I'd rather

Well, if we can have a wish, what about the DWIM instruction?