DEV Community

Discussion on: I've never become overly convinced that switch statements are that much cleaner than `if else if else if else if else`

Collapse
 
cheetah100 profile image
Peter Harrison

The main danger is the need to place a break; inline to prevent execution flowing through to the next block. Never found this very consistent with other conditional structures. Basically just an opportunity for a bug. It is also often abused, in that we don't want large conditional blocks of code. Usually there are better ways.