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 Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!hao!ames!amdahl!chuck From: chuck@amdahl.amdahl.com (Charles Simmons) Newsgroups: comp.lang.ada,comp.lang.c,sci.space,sci.space.shuttle Subject: Re: "C" vrs ADA Message-ID: <12962@amdahl.amdahl.com> Date: Wed, 26-Aug-87 15:32:08 EDT Article-I.D.: amdahl.12962 Posted: Wed Aug 26 15:32:08 1987 Date-Received: Fri, 28-Aug-87 06:27:31 EDT References: <1065@vu-vlsi.UUCP> <2231@cbmvax.UUCP> <36@sarin.UUCP> <6338@brl-smoke.ARPA> Reply-To: chuck@amdahl.amdahl.com (Charles Simmons) Distribution: na Organization: Amdahl Corp, Sunnyvale CA Xref: mnetor comp.lang.ada:575 comp.lang.c:3933 sci.space:2702 sci.space.shuttle:283 List-Id: In article <6338@brl-smoke.ARPA> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) writes: >The language the code is written in is really a very small part of >structured software methodology; one can apply the techniques in >COBOL, PL/I, FORTRAN, Pascal, or C. As a matter of fact, there are >C environments for sale that are just about as "safe" as Ada; most >typo and similar errors are caught by C compilation and "lint"; >unhandled exceptions in C typically produce an immediate core image >for debugging, etc. Very little difference, really. Um... How do these C environments detect subscript range errors in a piece of code like: strcpy(s,t) char *s, *t; { while (*s++ = *t++); return s;} Although an unhandled exception in C "typically" produces a dump, it does not "always" produce a dump. Also, the dump may occur long after the invalid code was executed, making it more difficult to figure out what went wrong. Yes, lint does work quite well. Unfortunately, I come from a PL1 background where the compiler generated type-checking information and the linker made sure everything matched. With lint, I have to have to perform an extra pass through my code. Admittedly, it's not a whole lot of work, but if type-checking were integrated with the compiler, things would move along a little faster... >C's one really major problem from the structured viewpoint is >that it has only two effective levels of name space, module >internal and global. This makes it necessary to strictly >allocate global names, which is an annoying but solvable problem. Tee hee... And here I was beginning to think the name space rules were one of the advantages of C. Actually, arn't there three levels of name space? "static global" or a variable that can only be seen from within a file, "procedure internal" or a variable that can only be seen from within the surrounding procedure (or "begin end" block), and "external global" or a variable that exists everywhere. -- Chuck