Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> in my opinion at least, are a bit harder to screw up, so I will always prefer them

My experience is the opposite - a sizeable chain of ifs has more that can go wrong precisely because it is more flexible. If I'm looking at a switch, I immediately know, for instance, that none of the tests modifies anything.

Meanwhile, while a missing break can be a brutal error in a language that allows it, it's usually trivial to set up linting to require either an explicit break or a comment indicating fallthrough.



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

Search: