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,ab1d177a5a26577d X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: "Chuck" Newsgroups: comp.lang.ada Subject: Re: What's wrong with C++? Date: Fri, 18 Feb 2011 00:23:12 -0600 Organization: A noiseless patient Spider Message-ID: References: <1ee1a434-4048-48f6-9f5e-d8126bebb808@r19g2000prm.googlegroups.com> <17coueqbf1p27.1g0wj3010saxe$.dlg@40tude.net> <4d5d4bec$0$13901$882e7ee2@usenet-news.net> Injection-Date: Fri, 18 Feb 2011 06:23:17 +0000 (UTC) Injection-Info: mx03.eternal-september.org; posting-host="Nvo31E/p3EKlT4bDI5+9FA"; logging-data="21191"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18r++4ziFjxZp2Tclpiz2TQ" X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994 X-RFC2646: Format=Flowed; Response X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 Cancel-Lock: sha1:XU1+k/qhUs4Rv80D63Ek8R/Nfto= X-Priority: 3 X-MSMail-Priority: Normal Xref: g2news2.google.com comp.lang.ada:18368 Date: 2011-02-18T00:23:12-06:00 List-Id: Hyman Rosen wrote: > On 2/17/2011 11:12 AM, Dmitry A. Kazakov wrote: >> On Thu, 17 Feb 2011 08:38:25 -0500, Peter C. Chapin wrote: >>> Could you elaborate a little on why you think type inference is bad? >> >> A variety of objections... > > And your objections are wrong because there are plenty > of types that can usefully be inferred by the compiler > and which can be written by the programmer only with > difficulty (at least in C++). Iterators over containers > are a prime example. If I have a C++ map > and I look something up, I have to declare > map::iterator i = my_map.find("hello"); > But that's silly - the compiler knows what type that > function returns, and it has a better chance of getting > it right than I do: > auto i = my_map.find("hello"); > will be supported by soon-to-be-standard C++. For now, > people dedicated to not sprinkling their code with these > iterator types have to push to a type-inferring template: > template void do_something(T i); > do_something(my_map.find("hello")); I forsee a division of roles: programmer and templater (In C++ land).