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-28 18:19:02 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.tele.dk!193.190.198.17!newsfeeds.belnet.be!news.belnet.be!newsfeed1.news.nl.uu.net!sun4nl!not-for-mail Message-ID: <3A9DB16F.F54BA3E0@infopuls.com> Date: Thu, 01 Mar 2001 02:18:23 +0000 From: Christof Brass Organization: InfoPuls X-Mailer: Mozilla 4.73 [en] (X11; U; Linux 2.0.36 i586) X-Accept-Language: de MIME-Version: 1.0 Newsgroups: comp.os.vms,comp.sys.dec Subject: Re: Drop C/C++ better sooner than later 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> <97hvro$hj4@freepress.concentric.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cache-Post-Path: fuchs.cyberlink.ch!unknown@193.247.146.165 X-Cache: nntpcache 2.3.3 (see http://www.nntpcache.org/) NNTP-Posting-Host: 193.246.253.18 X-Trace: 983412977 news.ch.uu.net 177 193.246.253.18 Xref: supernews.google.com comp.os.vms:20630 comp.sys.dec:2945 Rick Cadruvi wrote: > > > 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. I'm in. > 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. You seem to be an exception. And if you use PA in rare cases I believe these cases are justified. > > 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. I don't see any problem. If this is a mapping of the decision flow why not write it that way? > Even still, I would probably use other constructs like > a switch case statement or something. Switch can only be used directly if you base your decision on the very same attribute. > > > 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... We can, but this doesn't help us without a definition of what is good source?