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,c406e0c4a6eb74ed X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews2.google.com!not-for-mail From: kevin.cline@gmail.com (Kevin Cline) Newsgroups: comp.lang.ada Subject: Re: ADA Popularity Discussion Request Date: 15 Sep 2004 21:29:35 -0700 Organization: http://groups.google.com Message-ID: References: <49dc98cf.0408110556.18ae7df@posting.google.com> <2cR0d.1623$IO5.1267@trndny04> <17sx057ro5jw5$.t2qlaeoxg611$.dlg@40tude.net> <1095082522.132276@master.nyc.kbcfp.com> <18ym85v67zof3$.7oqswzjfgswr.dlg@40tude.net> <1095090665.624419@master.nyc.kbcfp.com> <68zmgy3b894u.rs67cy6jjfiq$.dlg@40tude.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 1095308976 28082 127.0.0.1 (16 Sep 2004 04:29:36 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 16 Sep 2004 04:29:36 +0000 (UTC) Xref: g2news1.google.com comp.lang.ada:3760 Date: 2004-09-15T21:29:35-07:00 List-Id: Georg Bauhaus wrote in message news:... > Dmitry A. Kazakov wrote: > : This is why I wrote about incorrectness. IF Ada's strings were designed as > : a set of related types, then "..." literals could be ones of/convertible to > : Unbounded_String and so an initialized ragged array would be no problem, > : instead of horrific: > : > : type Ragged is array (Integer range <>) of Unbounded_String; > : X : constant Ragged := > : ( To_Unbounded_String ("1"), > : To_Unbounded_String ("12"), > : To_Unbounded_String ("13") > : ); > > Is it really a good idea to sprinkle source code with unnamed > string values? (No matter in what language.) If all of them are > isolated in some module(s), where's the problem. Is it an > aesthetical problem to have to use Ada's verbosity with strings? It is a bit of a problem. Just like natural language composition, there's a fine line between too brief, too verbose, and just right. In the table above, the interesting parts are X and "1", "12", and "123". The three repetitions of To_Unbounded_String take up most of the text while saying nothing of interest, and could be left out if Ada supported implicit conversions at all. Perhaps Ada's prohibition of implicit conversions was a reaction to the problems they caused in FORTRAN and C programming. No doubt that FORTRAN and C got implicit conversions mostly wrong, but that doesn't mean that they are always bad. It's pretty obvious what it means to convert "1" to an unbounded string. BTW, the code above will also use memory inefficiently since there will be two copies of each string, one constant and one unbounded. C++ is as bad or worse if you want to initialize a vector, but is better if you are OK with: char const * const x[] = { "1", "12", "123" };