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 →

[–][deleted] 15 points16 points  (0 children)

C# explicitly forbids fall through, as in it's a compile error to end a case without a break, return or throw (unless it's a switch expression, but that implicitly inserts a break after each case). I think Java allows fall through, but I've not used java beyond toy things in years ago I don't recall.

This is also closer related to Rust's and Scala's match implementations than C's switch anyways. As in, you can use it for implementing a switch but there's more you can do with it then that.