When working with a fall-through in a case statement, is there any significance to including a semicolon? It seems that the fall-through functions as expected, and the semicolon may just be interpreted as an empty statement. But are there any advantages or disadvantages to including the semicolon? Is there a recommended best practice for this scenario? In the JavaScript example provided below, notice the semicolon in the first case statement.
switch(a) {
case 2:;
case 3: alert('hello'); break;
default: alert('default hello');
}
I am curious about the best practices surrounding this issue in C, C++, and Java as well. I have come across information indicating that in C#, a compilation error occurs if a case statement involved in a fall-through contains a statement. Would an empty statement like the one shown above trigger an error in C#?