Hacker News new | ask | show | jobs
by bengerbil 1904 days ago
One of the biggest strengths of switch statement, falling through to the next case, unless there's a break, is missing. Of course, I can't think of a good example right now, but I've used it.

Of course, I've also used switch statements in do { .. } while (false), so maybe I just need to be voted off the island.

1 comments

Falling through case statements bydefault has been the cause of so many bugs over the years.

Fall-through can be a useful behaviour, but it's definitely a foot-gun.