Path: utzoo!attcan!uunet!cs.utexas.edu!rutgers!rochester!pt.cs.cmu.edu!o.gp.cs.cmu.edu!andrew.cmu.edu!jh4o+ From: jh4o+@andrew.cmu.edu (Jeffrey T. Hutzelman) Newsgroups: comp.lang.c Subject: Re: The Sins of K&R Message-ID: <4b0hPyW00Vp8M7qVd1@andrew.cmu.edu> Date: 28 Sep 90 04:52:14 GMT References: <31604@nigel.ee.udel.edu> <12180@crdgw1.crd.ge.com> <2487@lectroid.sw.stratus.com>, <12221@crdgw1.crd.ge.com> Organization: Carnegie Mellon, Pittsburgh, PA Lines: 46 In-Reply-To: <12221@crdgw1.crd.ge.com> volpe@underdog.crd.ge.com (Christopher R Volpe) writes > Ok, how about requiring the programmer to make it explicit when > he/shewants it to fall through, rather than making that the default? > Like so: > >switch(ch) > { > case 'a': > do_a(); > continue; > case 'b': > do_a_or_b(); > } No!!! I LIKE being able to do the following: void some_func(void) { while(1) { /* because people don't seem to like for(;;) */ /* something to get a key - that's machine specific */ switch (key) { case '1': action_1(); break; case '2': action_2(); break; case 'q': return; default: putc('\007'); /* BEEP */ continue; /* SKIP the stuff after the swicth */ } /* now, do some things to be done ONLY if a selection was made, like redrawing the menu after a function has been performed */ } } ----------------- Jeffrey Hutzelman America Online: JeffreyH11 Internet/BITNET:jh4o+@andrew.cmu.edu, jhutz@drycas.club.cc.cmu.edu >> Apple // Forever!!! <<