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.5 required=5.0 tests=BAYES_05 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1d321b3a6b8bcab2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-01-23 19:35:26 PST Path: nntp.gmd.de!newsserver.jvnc.net!nntpserver.pppl.gov!princeton!gw1.att.com!fnnews.fnal.gov!usenet.eel.ufl.edu!news.mathworks.com!hookup!olivea!wetware!barrnet.net!rational.com!davidm From: davidm@rational.com (David Moore) Newsgroups: comp.lang.ada Subject: Re: "Subtract C, add Ada" Date: 24 Jan 1995 03:35:26 GMT Organization: Rational Software Corporation Message-ID: <3g1shu$ksc@rational.rational.com> References: <3fo2ot$su2@miranda.gmrc.gecm.com> <3fode9$dap@soleil.uvsq.fr> NNTP-Posting-Host: twain.rational.com X-Newsreader: NN version 6.5.0 #4 (NOV) Date: 1995-01-24T03:35:26+00:00 List-Id: [somebody wrote] >|> Personally, the lack of this sort of compactness in Ada, and things like >|> pre- and post-increment/decrement are one of my minor gripes about the >|> language. OK, its no big thing to write: >|> >|> P(I) := Q(I); >|> I := I + 1; >|> >|> instead of >|> >|> *p++ = *q++; >|> >|> but I actually *do* find the C representation easier/better etc. (perhaps >|> I'm wierd?) >Even if I like C, I think that this ++ is ugly and I'm glad that there isn't such >a thing in Ada. On the other hand what do you think about the operators += *= ... >They make thing shorter AND easier to read, a += 5; means exactly add 5 to a. >So don't you think that these construct have their place in Ada. The short circuit forms are kind of useful. On the other hand, what does this do? int j=0; int f() { return j++; } main () { int a[10]; .... a[f()]+=1; Is it the same or different to: a[f()]=a[f()]+1; ? I believe f() gets called once. I would have to get out the standrd to be 100% sure. It is also easy to write abominations like: -- search the table while (a[i++]!=b); Whenever you use post-increment in a condition, you always have to stop and wonder about your post-condition - I find it easier to always write the loop out in full. Shorthand forms can be like a bathtub containing two inches of water - not enough to soak, but enough to drown.