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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham 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!news2.google.com!proxad.net!newsfeed.stueberl.de!news2.telebyte.nl!news.jgaa.com!news.hacking.dk!pnx.dk!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: Re: Ada Popularity: Comparison of Ada/Charles with C++ STL (and Perl) Date: 26 Sep 2004 13:09:19 +0200 Organization: hacking.dk - Doing fun stuff with open source Sender: sparre@sparre.crs4.it Message-ID: References: NNTP-Posting-Host: 80.241.165.48 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: xyzzy.adsl.dk 1096196988 10028 80.241.165.48 (26 Sep 2004 11:09:48 GMT) X-Complaints-To: usenet@news.hacking.dk NNTP-Posting-Date: Sun, 26 Sep 2004 11:09:48 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:4202 Date: 2004-09-26T13:09:19+02:00 List-Id: Kevin Cline wrote: > As promised in the Ada popularity thread, I have taken one of the > Charles examples and reimplemented it in C++. I used only the > standard C++ language and libraries. The Ada/CHARLES main program > body is 118 (non-blank) lines of code, plus an additional 40 lines > of instantiations in eight other specification files, for a total of > 158 lines and 9 files. The C++ implementation is 76 (non-blank) > lines of code in a single file. For grins, I also wrote the program > in Perl. That took 14 lines. > > Summary: > > Ada/Charles 158 lines, 9 files > C++ 76 lines > Perl 14 lines If we really have to compete about the shortest implementation, then Bash with GNU tools beats all these languages: tr -c 'A-Za-z' '\n' | grep -v '^$' | sort | uniq -c | sort -nr | head And I suppose that anybody with a minimum of knowledge of Bash and the GNU tools will understand this immediately. But does that tell us that Bash is an excellent tool for controlling nuclear reactors, medical equipment, or just plain bioinformatics software? At most it tells us that if you just want to count words, Bash is probably a better implementation language than Ada, C++ or Perl. Jacob PS: The Bash version is also rather easy to internationalize. Just substitute 'A-Za-z' with '[[:lower:][:upper:]]'. -- LDraw.org Parts Tracker FAQ: http://www.ldraw.org/library/tracker/ref/faq/