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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,243dc2fb696a49cd X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews1.google.com!not-for-mail From: kevin.cline@gmail.com (Kevin Cline) Newsgroups: comp.lang.ada Subject: Re: Ada Popularity: Comparison of Ada/Charles with C++ STL (and Perl) Date: 23 Sep 2004 09:38:28 -0700 Organization: http://groups.google.com Message-ID: References: <11b4d.3849$d5.30042@newsb.telia.net> NNTP-Posting-Host: 198.23.5.11 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1095957508 28921 127.0.0.1 (23 Sep 2004 16:38:28 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 23 Sep 2004 16:38:28 +0000 (UTC) Xref: g2news1.google.com comp.lang.ada:4023 Date: 2004-09-23T09:38:28-07:00 List-Id: Georg Bauhaus wrote in message news:... > Kevin Cline wrote: > : begin -- Insert > : Insert (Map, To_Lower (Word), 0, I, B); > : declare E : Wordcount_Maps.Element_Subtype renames To_Access > : (I).all; > : begin > : E := E + 1; > : end; > : end Insert; > > Is the intention to first store a 0 with word, and then > to increment the value stored at word? My understanding is that Insert will insert a new key/value pair into the map if no entry exists for the given key, and outputs the iterator I pointing to the key/value pair for the given key. > > : is easier to understand than the corresponding C++ code: > : ++concordance[word]; > > Although this will require that you know how to separate the > queries and commands in this abbreviation. If you are not used > to how ++ and [] work in the context of maps, will this still be > easy to understand? The only question is whether the [] operator will create an entry if none exists. Thirty seconds with the reference will confirm that it does, and I would expect a professional programmer to be able to remember that. > AFAIK, [] does more than one thing behind the scenes. > ++ is known to be difficult to understand in that it > is not clear what ++ is referring to. Now are you claiming that C++ is hard to read because one has to learn the operator precedence rules? > Here, it is not incrementing > the concordance, although the operator is placed immediately before > the identifier. IIRC, the K&R book talks about (), ++, *, -> at > length. I guess there is a reaseon. > > For me this is similar to saying the APL is easy to read, which > is true if you know APL. Presumably anyone undertaking to program in APL will at some point come to know APL. You seem to be arguing that a tool is poor because it's use is not immediately obvious to the untrained. The effectiveness of a tool has to be judged by comparing the productivity of workers skilled with that tool.