[Lavanya Deepak] Lavanya Deepak
Technology for Better Business and Higher Standards of Life

Friday, September 26, 2008

The Lovely C# Switch Case

The Lovely C# Switch Case

One of the sweet things with a switch case statement in C# is that you have to specify the break statement or a goto statement and the fall through is a strictly no-no. The compiler would yell at you if skip the break statement.

Missing a break, continue statement is a common pitfall in switch construct is byfar the most common programming error that brings with it complicated debugging efforts and hidden bugs. With this cool power that C# compiler enforces, I think, we should also try ensuring that our programming practices in Java and JavaScript follow the same for cleaner and robust code.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home