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.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1ba8c21ddfbe0b1e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-01-06 05:53:19 PST Path: nntp.gmd.de!newsserver.jvnc.net!news.cac.psu.edu!news.pop.psu.edu!hudson.lm.com!nntp.club.cc.cmu.edu!newsfeed.pitt.edu!uunet!zib-berlin.de!news.th-darmstadt.de!terra.wiwi.uni-frankfurt.de!zeus.rbi.informatik.uni-frankfurt.de!news.dfn.de!uni-muenster.de!asterix.uni-muenster.de!rentmei From: rentmei@asterix.uni-muenster.de (Jahn Rentmeister) Newsgroups: comp.lang.ada Subject: Re: "Subtract C, add Ada" Date: 6 Jan 1995 13:06:51 GMT Organization: Westfaelische Wilhelms-Universitaet Muenster, Germany Message-ID: <3ejf9b$hbg@majestix.uni-muenster.de> References: <862035D1F1C@annwfn.com> NNTP-Posting-Host: asterix.uni-muenster.de X-Newsreader: TIN [version 1.2 PL2] Date: 1995-01-06T13:06:51+00:00 List-Id: Fred McCall (merlin@annwfn.com) wrote: : In mg@asp.camb.inmet.com Mitch Gart writes: : >Ada leaves less room for single-keystroke : >errors, such as the common C error of using = (assignment) instead of : >== (comparison); : I've always been curious. Just *where* is this a "common C error"? : I've seen lots of beginners and non-C programmers claim it is, but I : don't recall ever hearing of anyone who knew what they were doing (and : who was using a real tool -- say, lint -- to check their code) making : it. But you surely know about people who - at one time - wrote things like for (i=0; i < MAX_LOOP; i++); field[i]=GetFieldValue(i); The original statement you were criticizing says "single-keystroke errors, such as...". There are more of them than just assignment and empty loops. My golden C rule says "any sufficiently obscure error is due to a missing or superfluos semicolon". : >its type-abstraction facilities reduce the need for : >error-prone pointer manipulation; : Afraid this one doesn't seem to make sense. How does being able to : define a dozen incompatible types of integer "reduce the need for : error-prone pointer manipulation"? Afraid your answer doesn't seem to make sense. Read it again: He is talking about type-abstraction, i.e. abstract Data Types such as bags, stacks, linked lists, Bayer-Trees etc. In C, people do this using void pointers - this means no type checking at all. Even lint can't check anything there. This _is_ error-prone. In Ada, you may encapsulate a pointer (or whatever) into a limited private type, only allowing very few things to be done with the pointer/file/whatever. In C, this is not possible. (We're not talking about C++ right now.) : >and its modular facilities improve : >teams' coordination of effort. : Both languages are modular. I'm not sure how this is a 'win' unless : we're talking about totally inexperienced teams. We are talking about totally inexperienced teams here. And - again - read carefully: "Modular facilities", not "modularity" as such. The statement is that Ada provides some modular facilities that C does not provide, not that C isn't modular. Just two examples: In Ada, you can't use an obsolete package, because the compiler knows from the library it's obsolete. In C, it can become quite tricky to ensure this via make. Of course, you can do it, but you can't force people to use make neither to only produce correct makefiles. Private and limited private types are a "modular facility", too. With them, you know you don't rely upon internals of a module, because you know you can't even access them. : Well, Ada is certainly a better choice than C for a beginning language : to teach design concepts, etc. However, that isn't necessarily saying a : whole lot, since that wasn't what C was intended for. No one claimed that it is saying a lot. The statement was "look, Ada makes a success of a course where C failed. Let us teach Ada in beginning courses." : I'm also not sure : why that would be considered a 'plus', I'm sure it is a 'plus' for the students, for the teachers and for the university. Well-trained personnel is a 'plus' for the companies that hire them. That's why. : unless the idea behind Ada was to : come up with a good language for beginners; that wasn't the idea behind : it. The idea behind Ada was to come up with a perfect language, which did not at all work. (Nevertheless, it's the best try I've seen so far.) -Jahn -- ## PsionCrosspoint 3a Series V 0.99 B ##