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 01:22:56 -0700 Organization: http://groups.google.com Message-ID: References: <11b4d.3849$d5.30042@newsb.telia.net> <1095860313.176522@yasure> NNTP-Posting-Host: 24.219.97.214 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1095927776 24053 127.0.0.1 (23 Sep 2004 08:22:56 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 23 Sep 2004 08:22:56 +0000 (UTC) Xref: g2news1.google.com comp.lang.ada:3993 Date: 2004-09-23T01:22:56-07:00 List-Id: Benjamin Ketcham wrote in message news:<1095860313.176522@yasure>... > Bj?rn Persson wrote: > > 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. The line count is interesting only to the extent that it > > affects the readability. > > Well, the line count affects readability rather profoundly, in > this example! Not being an expert in any of the languages > concerned, I can take a more objective view of readability > perhaps; and I can say that if I had to figure out and maintain > any of these programs, the one that easily fits in entirety > on an 80x24 screen wins my approval. I.e., this > might not scale to larger projects: I'm not at all sure I'd > rather read a 1400-line Perl program than a 7600-line C++ > program or a 15800-line Ada program. Actually, "none of the > above" sounds most appealing. > > OTOH, it does not appear that the three programs actually > implement the same spec. E.g., error messages are different > (and missing in the Perl version), and if I'm not mistaken > the Perl version reads input from stdin, the other two take > a file argument -- or is while(<>) in Perl smart/twisted enough > to read from a filename in argv[] if present, else stdin? I > certainly recall that it has extensively overloaded behaviour. > Anyway, this is not even a vaguely fair test until all three > actually have the same behaviour in detail. I didn't actually run the Ada program, but I did run the C++ and Perl code. As I mentioned in the message, the Perl program does not give the same error messages, but in some sense it is more powerful than the Ada and C++ programs, because it works like a standard Unix filter, either reading from standard input or from the files specified on the command line. A more serious effort would take another few lines to at least handle the -h switch.