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 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 01:51:33 -0700 Organization: http://groups.google.com Message-ID: References: <11b4d.3849$d5.30042@newsb.telia.net> NNTP-Posting-Host: 24.219.97.214 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1095929494 26179 127.0.0.1 (23 Sep 2004 08:51:34 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 23 Sep 2004 08:51:34 +0000 (UTC) Xref: g2news1.google.com comp.lang.ada:3995 Date: 2004-09-23T01:51:33-07:00 List-Id: Bj�rn Persson wrote in message news:<11b4d.3849$d5.30042@newsb.telia.net>... > Kevin Cline wrote: > > > Ada/Charles 158 lines, 9 files > > C++ 76 lines > > Perl 14 lines > > Neat. Now let's take three identical persons who haven't seen this > program before, give them one version each, and see how long it takes > them to understand it. > In other words: What matters is how easy the program is to read and > maintain. I quite agree, and on that score the Perl code wins hands down. Anyone with a couple of months of Perl experience could understand the Perl program in about two minutes, and a halfway decent Perl programmer should be able to write that code in about ten minutes. It took me a bit longer because I had forgotten how to call sort and had to look it up. It's pretty hard to make the case that this Ada code: procedure Insert (Word : String) is I : Wordcount_Maps.Iterator_Type; B : Boolean; type Element_Access is access all Wordcount_Maps.Element_Subtype; for Element_Access'Storage_Size use 0; function To_Access is new Wordcount_Maps.Generic_Element (Element_Access); 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 easier to understand than the corresponding C++ code: ++concordance[word]; or the corresponding Perl code: ++$count{$word};