Re: switch statement

new topic     » goto parent     » topic index » view thread      » older message » newer message
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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu