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: 103376,dab7d920e4340f12 X-Google-Attributes: gid103376,public X-Google-Thread: 1014db,dab7d920e4340f12 X-Google-Attributes: gid1014db,public From: Sandy McPherson Subject: Re: C is 'better' than Ada because... Date: 1996/07/15 Message-ID: <31EA0B65.3EF8@wgs.estec.esa.nl>#1/1 X-Deja-AN: 169460556 references: <31e02c32.342948604@netline-fddi.jpl.nasa.gov> <4rr961$hdk@btmpjg.god.bel.alcatel.be> <31e180c5.430136383@netline-fddi.jpl.nasa.gov> <4s4adc$l4a@ecuador.it.earthlink.net> content-type: text/plain; charset=us-ascii organization: European Space Agency mime-version: 1.0 newsgroups: comp.lang.ada,comp.lang.c x-mailer: Mozilla 3.0b4Gold (X11; I; SunOS 5.4 sun4) Date: 1996-07-15T00:00:00+00:00 List-Id: John F. Bode wrote: > It *is* a lot harder to shoot yourself in the foot with Ada than it is > with C, though. However, when something does go wrong, your whole leg is likely to disappear! > > C was never designed to write *large* systems; reliance on text-based > #include files and inability to nest procedures alone is testimony to > that. > >.......... > > Since Ada was designed from the outset to solve large-scale system > problems, it provides the necessary tools, but it takes a while to learn > to use them effectively. I reject the notion that "it's just as easy to > do it in C" -- I've used both, and I will swear on a stack of Gideon > Bibles that no, it is *not* as easy to do it in C. Not if you expect the > goddamn thing to *work* when you're finished. > > John F. Bode > still working on an appropriate .sig... It depends upon which type of large system you wish to implement. Ever tried to write an operating system, or a configurable toolkit, which needs to use callbacks, in Ada? Yeuch!!! A Motif based GUI? Head for the hills! In these areas C or C++ wins every time. Whether this is a problem of Ada as a language is disputable, as these types of systems are traditionally the stamping ground of C anyway; however as a great believer in making life easy for myself, I would stick to C/C++ in these areas. If on the other hand you have a bare chip and need to write a complex embedded system, (and you have a GOOD Ada compiler), then Ada is probably a better starting point, because there are so many fetures built into the language which you have to do manually when coding good C. The main advantage that C has over Ada is that the compilers are generally very reliable (because of their small size) and produce efficient machine code. If you have good PA standards and the correct tools (lint, QAC, Purify, to name but a few) you can achieve very good results with C, sometimes better than with Ada. The main advantage Ada has over C is its well defined source architecture and easily employed data abstraction facilities and the tools which are built into the APSE; these have to be built into a good C program, but a plonker will bugger this up in Ada as well. Tasking looks like a good idea, but the implementations can be weak; in fact most spacecraft control systems I have seen implement their own tasking mechanisms, especially where they have to respond to hardware interrupts. Ada should be better than C for most applications, but has certain weaknesses. Let's see what Ada 95 brings, or shouldn't we all be looking at Eiffel? -- Sandy McPherson MBCS CEng. tel: +31 71 565 4288 (w) ESTEC/WAS P.O. Box 299 NL-2200AG Noordwijk