Path: utzoo!attcan!uunet!decwrl!shelby!neon!Gang-of-Four!dkeisen From: dkeisen@Gang-of-Four.Stanford.EDU (Dave Eisen) Newsgroups: comp.lang.c Subject: Re: switch break Keywords: switch break first language Message-ID: <1990Oct3.160403.517@Neon.Stanford.EDU> Date: 3 Oct 90 16:04:03 GMT References: <15611@csli.Stanford.EDU> <11428@alice.att.com> Sender: news@Neon.Stanford.EDU (USENET News System) Organization: Sequoia Peripherals Lines: 38 In article <11428@alice.att.com> ark@alice.att.com (Andrew Koenig) writes: >In article <15611@csli.Stanford.EDU>, poser@csli.Stanford.EDU (Bill Poser) writes: > >> I'm curious about the problem some people apparently have >> with the fall-through property of switch. > >Some people have difficulty understanding things that aren't Politically >Correct. And some of us have problems with unjustified snipes. I doubt anyone has difficulty understanding the semantics of switch, they are simple enough. That doesn't mean we agree with them. Any decent C programmer uses switch correctly every day of eir life, but I doubt that I am alone in having omitted it by accident once or twice and having been left with annoying bugs. We don't want to take away your precious fall-through cases, I'm glad that option is available too. But the each case separate type of switch clearly is the more common type, is much easier to follow, and is more correct politically, err, I mean is more structured. Besides, it always seems silly to me to have to write break a dozen times in a long switch to do what in my mind is the canonical operation. Changing the default to breaking and allowing the word continue to be used for fall-through where would make switch statements cleaner and would save typing in both the fall through and other case --- we wouldn't have to type "break;" and we wouldn't have to type "/* YES --- I REALLY MEAN TO FALL THROUGH */." -- Dave Eisen Home: (415) 323-9757 dkeisen@Gang-of-Four.Stanford.EDU Office: (415) 967-5644 1447 N. Shoreline Blvd. Mountain View, CA 94043