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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,1042f393323e22da X-Google-Attributes: gid109fba,public X-Google-Thread: 1014db,1042f393323e22da X-Google-Attributes: gid1014db,public X-Google-Thread: 103376,1042f393323e22da X-Google-Attributes: gid103376,public From: terryc@tenberry.com (Terry Colligan) Subject: Re: Any research putting c above ada? Date: 1997/04/11 Message-ID: <33636746.328095140@client.ne.news.psi.net>#1/1 X-Deja-AN: 232348428 References: <5ih6i9$oct$1@waldorf.csc.calpoly.edu> <5ijb0o$ajc@ns1.sw-eng.falls-church.va.us> <334d3da5.14386594@aplcen.apl.jhu.edu> <2senchydgk.fsf@hpodid2.eurocontrol.fr> Organization: Tenberry Software, Inc. Newsgroups: comp.lang.c++,comp.lang.c,comp.lang.ada Date: 1997-04-11T00:00:00+00:00 List-Id: Steve Jones - JON wrote: >haggedk1@ulysses.jhuapl.edu (CubanPete) writes: > >[snip] >> Come on now Phil. There is no language that produces software that >> works "more right" than another. Software is either right or it is >> not. Ada may have a great debugger but VMS types will argue all day >> about how much better the debuger is on the VAX but I dont see tons of >> UNIX folks in VMS classes. >On my last project we use C and Ada, the bug count in the Ada code was >over 1/3 that of the C code. And tracking down bugs in Ada is much easier, >the code falls over it tells you the brief reason (eg constraint error) and >the line at which the error was raised and the stack trace. You can then add >exception handlers et al to secure the system. It provides in built range >checking and strong typing. > >In C assigning to an unitialised pointer will cause either a crash or >wild behaviour and never tell you, in Ada it will crash and tell you why. A checking C environment will stop and tell you, as well. Just because most C environments don't do much checking doesn't mean it can't be done. Any assignment using an uninitialized pointer in our InstantC incremental environment will tell you nicely that you have just tried to use an uninitialized pointer. I am not offering any data or opinion about Ada vs C, since I don't use Ada -- I'm just saying C can be made pretty safe, if you choose to. >In Ada you can restrict the user from assigning between incompatible types, >you can data hide etc etc. > >The bug count and cost of Ada is much less than that of C, just because some >of the bugs that occur regularly in C (int a[10]; a[10] = 4; anyone ?) cannot Similarly, this kind of error will be trapped at run-time in InstantC. >be done in Ada. Both Ada and C can produce correct programs but IME it is >easier to do in Ada, the same would go for Eiffel v C++, a HLL v a MLL presents >similar advantages to a MLL over a LLL. > >I know C, I know Ada and various languages besides, if I was writting a quick >check or hack I'd use C, if writting a large system I'd use Ada. The advantage >of Ada isn't in the debugger but in the compiler, eg > >C: >typedef int cleared_flight_level; >typedef int airspeed; > >airspeed a = 4; >cleared_flight_level cfl = 5; > >... > >cfl = a; We don't check for this, yet, but it has been done by at least one interpreter for C. Just because many/most C programmers chose to not use a checking environment doesn't mean C can't be quite safe. When we wrote the standard, we made sure that checking was allowable, although not required. It's a matter of philosophy and choice. --------------------------------------------------------- Terry Colligan, President terryc@tenberry.com Tenberry Software, Inc. http://www.tenberry.com *InstantC C interpreter/incremental compiler for Windows: More reliable C code developed in half the time! info@tenberry.com phone:(508)653-6006 fax:(508)655-2753