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.7 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,ab1d177a5a26577d X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Hyman Rosen Newsgroups: comp.lang.ada Subject: Re: What's wrong with C++? Date: Thu, 17 Feb 2011 10:09:06 -0800 (PST) Organization: http://groups.google.com Message-ID: Reply-To: comp.lang.ada@googlegroups.com NNTP-Posting-Host: 204.253.252.20 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1297966146 13722 127.0.0.1 (17 Feb 2011 18:09:06 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 17 Feb 2011 18:09:06 +0000 (UTC) In-Reply-To: <4d5d5f0d$0$6769$9b4e6d93@newsspool3.arcor-online.net> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=204.253.252.20; posting-account=NhXkHQoAAADUfNLRQrjReWdGEn5uz9E_ User-Agent: G2/1.0 Xref: g2news1.google.com comp.lang.ada:17346 Date: 2011-02-17T10:09:06-08:00 List-Id: On 2/17/2011 12:46 PM, Georg Bauhaus wrote: > Can I have > auto iterator i = ...; > too, assuming iterator denotes a common iterator type? > This will allow me to know what type i is without having > to do the inference myself! No, but you can say auto map_iterator = my_map.find("x"); so your variable names will guide your understanding. You do that in Ada anyway, since the variable can be used far away from its declaration. > Ada.Containers' Cursor doesn't have a centrally > declared interface, just like iterator; some have filed > complaints about this. Why is it that, seemingly, everybody > in the compiler makers guild is so fond of omissions boiling > down to obfuscation or bragging about inferential skills? > Programming is neither selling small print nor omissions. > Or, wait! Is it? C++ is very susceptible to horrible runaway type names because it does have automatic instantiation of templates, and especially in the presence of template metaprogramming. Without automatic instantiation and partial specialization, Ada has rather less need for this. (Which does not mean C++ is bad, just different.) In C++, expression templates can be used to build up parse trees from expressions rather than having them be evaluated, and the type of such an expression is a nested cascaded monstrosity that is essentially impossible for a human to write correctly. Such results can be held by a pointer or reference to a base class, but the compiler can just infer the right type without need for that.