From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_20,INVALID_DATE, MSGID_SHORT autolearn=no autolearn_force=no version=3.4.4 Xref: utzoo comp.software-eng:3129 comp.lang.ada:3416 comp.lang.c:26732 comp.lang.lisp:2894 comp.lang.misc:4383 comp.lang.modula2:2159 comp.lang.pascal:3203 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!rpi!crdgw1!jupiter!kassover From: kassover@jupiter.crd.ge.com (David Kassover) 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: <5915@crdgw1.crd.ge.com> Date: 9 Mar 90 16:18:33 GMT References: <1004@micropen> <8218@hubcap.clemson.edu> <2596@gmu90x.gmu.edu> <672@software.software.org> Sender: news@crdgw1.crd.ge.com Followup-To: comp.software-eng Organization: General Electric Corporate R&D Center List-Id: In article <672@software.software.org> ciardo@software.org (Gianfranco Ciardo) writes: ... > >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; > } No, but without fall through, you would write such a thing upside down. Or do something else. A couple of weeks ago I mentioned a (please bear with me) Fortran preprocessor called FLEX, which provided 4 kinds of case statement, two with fall through, two without. One instance: A particular programmer, whom I have worked with for about 10 years, rarely, if ever, used the FLEX cases-with-fallthrough. Now that he has learned C (and not recently, bTW), it seems like he goes out of his way to *USE* fall-through. I wonder why it is so difficult for language designers to provide more than one way to do things?