problems/risks due to programming language, stories requested

David Kassover kassover at jupiter.crd.ge.com
Sat Mar 10 02:18:33 AEST 1990


In article <672 at software.software.org> ciardo at 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:
>                            <statementA>;
>                    case FOUR_THINGS:
>                            <statementB>;
>                    case THREE_THINGS:
>                            <statementC>;
>                    case TWO_THINGS:
>                            <statementD>;
>                    case ONE_THING:
>                            <statementE>;
>                    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?



More information about the Comp.lang.c mailing list