Xref: utzoo comp.software-eng:3117 comp.lang.ada:3409 comp.lang.c:26709 comp.lang.lisp:2891 comp.lang.misc:4376 comp.lang.modula2:2157 comp.lang.pascal:3200 Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!software.org!ciardo From: ciardo@software.org (Gianfranco Ciardo) Newsgroups: comp.software-eng,comp.lang.ada,comp.lang.c,comp.lang.lisp,comp.lang.misc,comp.lang.modula2,comp.lang.pascal Subject: Re: problems/risks due to programming language, stories requested Message-ID: <672@software.software.org> Date: 8 Mar 90 21:44:48 GMT References: <1004@micropen> <8218@hubcap.clemson.edu> <2596@gmu90x.gmu.edu> Sender: news@software.org Reply-To: ciardo@software.org (Gianfranco Ciardo) Organization: Software Productivity Consortium, Herndon, Virginia Lines: 26 In article lou@atanasoff.rutgers.edu (Lou Steinberg) writes: > > >> A multi-case switch is very handy in many situations to reduce identical > > >> treatments for similar cases. > ARGHHH!! That is what subroutines (and macros) are for - to handle > common code. And if your language makes them too expensive, either in > terms of run time or in terms of programmer effort, then THAT is an > even worse problem with the language than the problems with break. I think you miss completely the point. Using subroutines is not going to help you make the code shorter, more compact, or less repetitious (which is not) in a case like this: switch (what_to_do) { case FIVE_THINGS: ; case FOUR_THINGS: ; case THREE_THINGS: ; case TWO_THINGS: ; case ONE_THING: ; case NOTHING: break; }