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=0.7 required=5.0 tests=BAYES_00,INVALID_DATE, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Xref: utzoo comp.lang.ada:3304 comp.lang.c:26223 Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!think!snorkelwacker!mit-eddie!uw-beaver!uw-june!fred.cs.washington.edu!machaffi From: machaffi@fred.cs.washington.edu (Scott MacHaffie) Newsgroups: comp.lang.ada,comp.lang.c Subject: Re: problems/risks due to programming language Message-ID: <10838@june.cs.washington.edu> Date: 23 Feb 90 06:46:25 GMT References: <10811@june.cs.washington.edu% <8126@hubcap.clemson.edu% Sender: news@cs.washington.edu Reply-To: machaffi@fred.cs.washington.edu.cs.washington.edu (Scott MacHaffie) Organization: University of Washington, Computer Science, Seattle List-Id: In article <8126@hubcap.clemson.edu% billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu writes: %From machaffi@fred.cs.washington.edu (Scott MacHaffie): %% No, it is necessary to use a statement to indicate that the current case %% statement is finished...like an "end case" or the next "when =% " in ADA. % % Such a statement already exists: either the next "case Value:", or % the } which ends the switch. Why is it necessary to use a "break"? example: switch (x) { /* x is a character, for example */ case '0': case '1': ... case '9': print_digit(x); break; case 'a': ... case 'z': print_lowercase(x); break; } The semantics of a C switch/case statement are different than the semantics of an ada case/when. % The problem cannot simply be defined out of existence by saying, % in essence, that good programmers don't make mistakes. All human % programmers make mistakes, and a well-designed language will help % to minimize this particular tendency. In this case, C does not. Good programmers understand the language they are using -- good programmers are literate. No language can eliminate errors. Good software engineering practices should be used to (try to) catch language-specific errors. %%% This is certainly true; Brooks and others have noted that the good %%% software engineering practices which are routinely introduced in %%% conjunction with the Ada language are responsible for more of the %%% resulting improvements than the fact that the Ada language was %% %% Well, these practices are certainly NOT being introduced in the %% universities (at least not here). % % In that case, I strongly suggest that you immediately bring % this fact to the attention of the software engineering faculty % at washington.edu. At other universities (e.g., Clemson), Ada % *is* introduced in conjunction with software engineering. Software engineering faculty? I wish. None of the undergraduate classes here touch software engineering, and I think at most one of the graduate classes does. Anyone who wants to be a software engineer here has to pick it up from other sources. Scott MacHaffie