From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f7344,8be18979db11f51c X-Google-Attributes: gidf7344,public X-Google-Thread: 1164f8,fb631c9316319fef X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 2001-02-27 20:50:05 PST Path: supernews.google.com!sn-xit-03!supernews.com!news-feed.riddles.org.uk!newsfeed.direct.ca!look.ca!sjc1.nntp.concentric.net!newsfeed.concentric.net!global-news-master From: "Rick Cadruvi" Newsgroups: comp.os.vms,comp.sys.dec Subject: Re: Drop C/C++ better sooner than later Date: 28 Feb 2001 04:46:48 GMT Organization: Concentric Internet Services Message-ID: <97hvro$hj4@freepress.concentric.net> References: <87n1baae6s.fsf@prep.synonet.com> <97bm3a$7tv@gap.cco.caltech.edu> <3A99AED0.5DF07890@infopuls.com> <97cd06$hcn$1@pyrite.mv.net> <97egck$vc6$3@info.cs.uofs.edu> <3A9AEFCD.AFC8431@infopuls.com> <97etsu$j41$1@pyrite.mv.net> <3A9B023A.CBD414A5@infopuls.com> NNTP-Posting-Host: 64.0.157.124 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Xref: supernews.google.com comp.os.vms:20459 comp.sys.dec:2893 > That is an interesting list, because it totally omits the most important > defect the Ada community sees in C -- pointer arithmetic. For those of > us with many years of Bliss experience, pointer arithmetic must seem like > it does to the average C-only programmer ... the only way to handle some > programs. But once one has a suitable amount of experience with Ada (or > some other language without pointer arithmetic) it is obvious that the > use of pointer arithmetic is a significant vulnerability. I do agree that pointer arithmetic in C is particularly bad. I guess I forgot about it because I don't use it. When I do need to I always type cast or declare things as (char *). Anyone who faults C based on the way pointer arithmetic is done and the excessive type casting it causes will get NO argument from me. As far as pointer arithmetic being problematic, I agree it can be, but it can also be very powerful. Not having to program around a problem makes code more straightforward and therefore less likely to have bugs. > While the VMS device driver environment is not suitable for Ada, that is > mainly the result of the way that data structure definitions are provided. > About the only aspect of VMS device drivers I can think of that could not > theoretically be done in a safe language would be a driver for a physical > device on a VAX, to that @!#@$#!%$$#$% wait-for-interrupt-and-keep-channel > linkage (at least "linkage" is what they would call it if they ever had > bothered to support it from Bliss. > I would say that this is true. > > When I even thing about using a ELSE statement, I force myself to justify > > it's use. > > Most programmers think using ELSEs is really great and liberally do nested > > IF then ELSEs. > > But I think that is fine: > > if WINE = RED > then > .... > elsif SIZE > 500 > then > .... > elsif AGE /= 17 > then > .... > else > .... > end if; Your example is fine. I am talking about something like: if () {if () { } else { if { } else { } } } else Its the extra nesting that gets problematic. Your example doesn't display that type of behavior. Even still, I would probably use other constructs like a switch case statement or something. > > > Teach programmers to write code well, and new progrmaming languages will > > evolve that help us solve the problems better and not ones that prevent us > > from > > doing things we shouldn't do in the first place unless they are REALLY > > required. > > But we seem to disagree on what constitutes well-written. Can we at least agree that if programmers were taught to write good code in the first place then a lot of the problems some languages try to solve would be less of an issue? Rick Cadruvi...