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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1116ece181be1aea X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-09-25 12:57:22 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fu-berlin.de!uni-berlin.de!adsl-213-200-246-247.cybernet.CH!not-for-mail From: Vinzent 'Gadget' Hoefler Newsgroups: comp.lang.ada Subject: Re: Is the Writing on the Wall for Ada? [although this thread changed to something else a long time ago] Date: Thu, 25 Sep 2003 21:56:33 +0200 Organization: JeLlyFish software Message-ID: References: <3F67AAC6.2000906@attbi.com> <3F7024F8.1000102@crs4.it> <3F71A78A.5000701@crs4.it> Reply-To: v.hoefler@acm.org NNTP-Posting-Host: adsl-213-200-246-247.cybernet.ch (213.200.246.247) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: news.uni-berlin.de 1064519840 6898799 213.200.246.247 (16 [175126]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:42931 Date: 2003-09-25T21:56:33+02:00 List-Id: Russ wrote: >"Jeff C," wrote in message = news:... >> "Vinzent 'Gadget' Hoefler" wrote in message >> news:bkubhj$5v7t7$1@ID-175126.news.uni-berlin.de... >> Russ wrote: >>=20 >> >just basic common sense. Let me ask you which of the following is = more >> >readable: >> > >> >lwienfowowoenfnowoqndfoowopqihjefhnowqoowldvno :=3D >> > lwienfowowoenfnowoqndfoowopqihjefhmowqoowldvno + 1 >> > >> >or >> > >> >lwienfowowoenfnowoqndfoowopqihjefhnowqoowldvno +=3D 1 >>=20 >> They are not equivalent. > >You are very observant. Well. I have to admit, I was - of course - expecting something like this. >But how long did it take you to determine that >the two statements are not equivalent? How long it took to compare the characters, three seconds, five seconds. Obviously, such a thing is not done at a first glance like you usually do when you look over some code to find relevant places when you are scanning it for errors. >My point is that the second >form, using augmented assignment, makes it instantly clear that one >variable is being incremented. It does make it clear if and only if you know what this weird operator +=3D means (I know, this is not a strong argument). Well, perhaps it even does not, speaking for myself, I still find this one one of the most cryptic parts in C-like languages (together with the funny and unspeakable names of all the C-library functions and the hyper-cryptic boolean/logical operators, the latter being my "favourites", I still don't get them and probably I'll never will). >That means better readability. I don't like it, but in this particular case I probably should agree. But... >> One lesson learned: You really should take care of your variable's >> names. :) > >As I said before, those variable names are obviously ridiculous, but >if I had more time I could come with a reasonable example of a >complicated data structure illustrating the exact same point. Yes, I know, we did that before. And I will come against it with a simple renaming declaration that makes everything so much easier. ;) >> Yipes! I think you just made the point that the C++ syntax is less = error >> prone...Now this mis-named thread will never die. > >Yes, I think I *have* made the point that this particular aspect of >C++ syntax is less error prone and more readable than Ada. The problem I have with this syntax is that it at first it is not clear what it means, it breaks at least my normal reading flow. And like you mixed up variable names that might be not detectable at the first glance, you also could mix it up with a normal assignment operation. Yes, I consider "+=3D" and ":=3D" as looking not very different. So the result is still not better in terms of safety and readable code, we would just exchange the possibility of mixing up something with the possibility to mix up something else. What would we gain from that? The acceptance of some idiotic kids who like to code one buffer overflow after another? ;-> The second thing: If we introduce such a syntax in Ada, this means it *will* be used even in simple cases like |Count :=3D Count + 1; that converts to |Count +=3D 1; (because programmers *are* lazy) and IMO this *would* definitely have a large impact on general readability. I'd say, the general effect on readability would be worse than that what we would get back from adding something like the "+=3D"-operator syntax to the language. >The same principle applies here. If Ada enthusiasts are too blind to >see the obvious deficiency of the lack of augmented assignment >operators, then what hope is there for Ada when it has so much else >going against it? Well, I still consider |Add (lwienfowowoenfnowoqndfoowopqihjefhnowqoowldvno, 1); (with a "pragma Inline (Add);" if you want so) a good alternative. Call it a compromise. Well, I know the C++-community wouldn't accept it, because "+=3D" is so much "nicer", but I don't care about them. They don't care about me, so we're even. :) Vinzent.