Re: switch statement
- Posted by jeremy (admin) Mar 25, 2009
- 1328 views
Critic said...
Are there any reasons for the design of the new switch statement? I thought C's switch was widely critised for its bug-proneness. IMHO, Pascal's case is nicer.
I've never heard that before. I know some languages have a select statement that has implied breaks as oppose to our switch which has fall-thru. Having fall-thru can be quite nice in many situations. Simply be aware that fall-thru exists and you shouldn't have any more problem with it than any other decision construct.
Jeremy