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-07 09:46:24 PST Newsgroups: comp.lang.ada Path: nntp.gmd.de!newsserver.jvnc.net!nntpserver.pppl.gov!princeton!rutgers!att-out!nntpa!not-for-mail From: ka@socrates.hr.att.com (Kenneth Almquist) Subject: Re: "Subtract C, add Ada" Message-ID: Sender: news@nntpa.cb.att.com (Netnews Administration) Nntp-Posting-Host: socrates.hr.att.com Organization: AT&T References: <862035D1F1C@annwfn.com> Date: Fri, 6 Jan 1995 23:36:49 GMT Date: 1995-01-06T23:36:49+00:00 List-Id: In article <862035D1F1C@annwfn.com>, Fred McCall 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. I confuse "=" and "==" periodically even though I've used C for years. I generally don't use lint. I just ran this "real tool" on the program: #include #include main(int argc, char **argv) { printf("hello, world\n"); exit(0); } The result is four useless messages: hello.c(4): syntax error at or near type word "int" hello.c(7): warning: main() returns random value to invocation environment exit value declared inconsistently llib-lc(236) :: hello.c(6) printf returns value which is always ignored >> 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"? I'm not sure what was intended here either. Ada has generic packages and procedures, which makes it easier to write type-safe library routines which manipulate pointers. >> 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. I took a software engineering course in which included a group project. The group I was in defined all of the interfaces in Modula 2. Some of the code was written in C because nobody on the project knew Modula 2 well, but I don't think we would have had a chance of completing the project in the ten weeks allotted if we hadn't used Modula 2 for the interfaces. >> This experience, McCormick notes, "has convinced all my faculty >> colleagues to support teaching Ada in our beginning courses. This >> spring semester, the first student with Ada as their mother tongue >> will enroll in my course. I can only imagine what these teams will >> accomplish". > > 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. I'm also not sure > why that would be considered a 'plus', unless the idea behind Ada was to > come up with a good language for beginners; that wasn't the idea behind > it. C was intended for (or at least the early feedback on its design came from) programmers writing individual programs. In contrast, Ada was explicitly designed to support multi-person projects. It is nice to see that the relative usefulness of these languages for group projects reflects the intentions of the language designers. Kenneth Almquist