Hacker News new | past | comments | ask | show | jobs | submit login

At least for me, the feelings you describe are characteristic of a footgun, not a WAT. A WAT is rather a desperate bewilderment as to who could ever design the thing that way and why, and for switch statements computed gotos are the answer to that question.

As for the footgun issue, I mean, it could be one in theory, sure. But I don’t think I’ve ever seen it actually fired. And I can’t really appreciate the Javaesque “abuse” thinking—it is to some extent the job of the language designer to prevent the programmer from accidentally doing something bad, but I don’t see how it is their job to prevent a programmer from deliberately doing strange things, as long as the result looks appropriately strange as well.

(There are reasons to dislike C’s switch statement, I just don’t think the potential for “abuse” is one.)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: