comp.lang.ada
 help / color / mirror / Atom feed
From: "Peter C. Chapin" <PChapin@vtc.vsc.edu>
Subject: Re: What's wrong with C++?
Date: Fri, 18 Feb 2011 08:37:10 -0500
Date: 2011-02-18T08:37:10-05:00	[thread overview]
Message-ID: <alpine.WNT.2.00.1102180828190.5260@WHIRLWIND> (raw)
In-Reply-To: <ijl2qg$ju1$1@news.eternal-september.org>

On Fri, 18 Feb 2011, Chuck wrote:

>> You can still define the types you need. Inference just means that you 
>> typically don't have to bother with explicit declarations: create the 
>> objects you need (of the types you need) and let the compiler work out 
>> the details.
>
> And the the MAINTAINER try to figure out WTF is going on with the
> UNREADABLE code! Uncomprehensible code is useless code.

I agree that rampant type inference isn't good for readibility. But as has 
been mentioned here elsewhere, even languages that support aggressive type 
inference typically require type annotations in interfaces (aka 
specifications). Anyway, I like the way Scala does type inference. You do 
have to annotate parameter types of methods but the compiler can infer the 
types on locals and also on function literals that are embedded inside other 
expressions. For instance:

def simpleMethod(counters: List[Int]) =
   counters filter { _ > 1 }

In this trivial example the compiler infers the type of the function literal 
as Int => Boolean based on its use as a argument to the filter method as 
applied to a list of integers. The return type of simpleMethod is also 
inferred as a list of integers as well (the result of filter).

The fact that you have to annotate the parameter types and yet don't have to 
bother annotating all the local types seems like a good compromise between 
documentation and conciseness.

In any case, functional languages are becoming industrially significant. 
Microsoft is fully supporting F# (an OCaml dialect) and Scala is doing well 
in the Java ecosystem. I think we will see more of this sort of thing in the 
future rather than less.

Peter




  reply	other threads:[~2011-02-18 13:37 UTC|newest]

Thread overview: 155+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-16 17:37 What's wrong with C++? KK6GM
2011-02-16 17:58 ` Hyman Rosen
2011-02-16 18:18   ` KK6GM
2011-02-16 20:25     ` Chris Moore
2011-02-20  4:47       ` Chuck
2011-02-20  4:45     ` Chuck
2011-02-16 19:35   ` Robert A Duff
2011-02-16 20:32     ` Hyman Rosen
2011-02-16 23:31     ` Georg Bauhaus
2011-02-16 20:03   ` Fritz Wuehler
2011-02-16 20:09     ` Hyman Rosen
2011-02-17 17:39     ` Paul Colin Gloster
2011-03-01 15:52       ` Martin Krischik
2011-02-16 23:27   ` Peter C. Chapin
2011-02-16 18:32 ` Pascal Obry
2011-02-16 19:09   ` Hyman Rosen
2011-02-16 19:36     ` KK6GM
2011-02-16 20:07       ` Hyman Rosen
2011-02-17 18:48         ` Yannick Duchêne (Hibou57)
2011-02-17 18:53           ` Ludovic Brenta
2011-02-17 19:14             ` Yannick Duchêne (Hibou57)
2011-02-17 19:38             ` Hyman Rosen
2011-02-17 19:55               ` Ludovic Brenta
2011-02-17 20:11                 ` Hyman Rosen
2011-02-17 20:51                   ` Ludovic Brenta
2011-02-17 21:03                     ` Hyman Rosen
2011-02-17 21:32                       ` Ludovic Brenta
2011-02-17 21:45                         ` Hyman Rosen
2011-02-17 21:07                 ` Jeffrey Carter
2011-02-17 20:32               ` Yannick Duchêne (Hibou57)
2011-02-17 20:37                 ` Hyman Rosen
2011-02-17 22:54               ` J-P. Rosen
2011-02-17 23:02                 ` Hyman Rosen
2011-02-17 23:03                 ` Hyman Rosen
2011-02-17 23:17                   ` J-P. Rosen
2011-02-17 23:27                     ` Hyman Rosen
2011-02-18  6:56                       ` J-P. Rosen
2011-02-18 19:58                       ` Edward Fish
2011-02-18 20:04                         ` Hyman Rosen
2011-02-18 20:10                           ` Edward Fish
2011-02-18 20:27                             ` Hyman Rosen
2011-02-18 22:00                               ` Edward Fish
2011-02-17 19:34           ` Hyman Rosen
2011-02-16 20:49   ` Nasser M. Abbasi
2011-02-16 21:12     ` Hyman Rosen
2011-02-16 23:07       ` J-P. Rosen
2011-02-16 23:23         ` Hyman Rosen
2011-02-17 20:51         ` Yannick Duchêne (Hibou57)
2011-02-17 20:57           ` Hyman Rosen
2011-02-16 23:35       ` Peter C. Chapin
2011-02-17  3:35         ` Shark8
2011-02-17 20:54           ` Yannick Duchêne (Hibou57)
2011-02-17 22:19             ` Shark8
2011-02-17 11:04         ` J-P. Rosen
2011-02-17 11:52           ` Georg Bauhaus
2011-02-17 14:30             ` J-P. Rosen
2011-02-17 16:29               ` Hyman Rosen
2011-02-17 17:32                 ` Peter C. Chapin
2011-02-18  6:54                   ` Chuck
2011-02-17 21:04                 ` Yannick Duchêne (Hibou57)
2011-02-18  7:02                   ` Chuck
2011-02-17 22:50                 ` J-P. Rosen
2011-02-17 23:00                   ` Hyman Rosen
2011-02-17 23:08                     ` J-P. Rosen
2011-02-19 15:24                     ` Marco
2011-02-19 16:39                       ` Frank J. Lhota
2011-02-19 19:51                         ` Nasser M. Abbasi
2011-02-19 22:36                           ` Anonymous
2011-02-19 22:45                             ` Nasser M. Abbasi
2011-02-20  0:55                               ` Nomen Nescio
2011-02-20  1:51                                 ` Nasser M. Abbasi
2011-02-20  9:49                                   ` Vinzent Hoefler
2011-02-18  7:07                   ` Chuck
2011-02-17 21:00             ` Yannick Duchêne (Hibou57)
2011-02-17 22:55               ` Georg Bauhaus
2011-02-18  3:09                 ` Yannick Duchêne (Hibou57)
2011-02-18  9:37                   ` Georg Bauhaus
2011-02-18 11:34             ` richard
2011-02-18 11:56               ` Georg Bauhaus
2011-02-18 13:26                 ` richard
2011-02-18 14:15                   ` Georg Bauhaus
2011-02-17 20:58           ` Yannick Duchêne (Hibou57)
2011-02-18  7:11             ` Chuck
2011-02-18 17:17               ` Paul Colin Gloster
2011-02-20  4:35                 ` Chuck
2011-02-18  7:16         ` Chuck
2011-02-18  7:27         ` Chuck
2011-02-18  7:28         ` Chuck
2011-02-17  3:41 ` Mike Sieweke
2011-02-17 13:31   ` Peter C. Chapin
2011-02-18  5:15     ` Mike Sieweke
2011-02-18  6:41       ` Chuck
2011-02-18  6:39     ` Chuck
2011-02-17 15:30   ` Hyman Rosen
2011-02-17 17:31     ` Martin
2011-02-17 19:12     ` Yannick Duchêne (Hibou57)
2011-02-17 18:51   ` Yannick Duchêne (Hibou57)
2011-02-18  6:45     ` Chuck
2011-02-18  6:38   ` Chuck
2011-02-17  8:31 ` Ludovic Brenta
2011-02-17  9:02   ` Dmitry A. Kazakov
2011-02-17 13:38     ` Peter C. Chapin
2011-02-17 16:12       ` Dmitry A. Kazakov
2011-02-17 16:25         ` Hyman Rosen
2011-02-17 17:46           ` Georg Bauhaus
2011-02-17 18:09             ` Hyman Rosen
2011-02-18  5:59               ` Chuck
2011-02-17 18:22           ` Dmitry A. Kazakov
2011-02-18  6:23           ` Chuck
2011-02-17 17:27         ` Peter C. Chapin
2011-02-17 18:46           ` Dmitry A. Kazakov
2011-02-18  6:15           ` Chuck
2011-02-18 13:37             ` Peter C. Chapin [this message]
2011-02-20  4:33               ` Chuck
2011-02-17 19:29         ` Yannick Duchêne (Hibou57)
2011-02-18  9:17           ` Dmitry A. Kazakov
2011-02-17 19:34         ` Yannick Duchêne (Hibou57)
2011-02-18  9:41           ` Dmitry A. Kazakov
2011-02-17 19:25       ` Yannick Duchêne (Hibou57)
2011-02-18  6:20       ` Chuck
2011-02-17 19:19     ` Yannick Duchêne (Hibou57)
2011-02-17 20:50       ` Georg Bauhaus
2011-02-17 21:08         ` Yannick Duchêne (Hibou57)
2011-02-18  0:13           ` Georg Bauhaus
2011-02-18  6:12         ` Chuck
2011-02-18  7:47           ` Yannick Duchêne (Hibou57)
2011-02-18  6:07     ` Chuck
2011-02-18 17:38       ` Paul Colin Gloster
2011-02-17 11:51 ` Ludovic Brenta
2011-02-17 20:47   ` Yannick Duchêne (Hibou57)
2011-02-20  4:41 ` Chuck
2011-02-20 10:28   ` Brian Drummond
2011-02-20 14:48   ` Britt Snodgrass
2011-10-04 20:51 ` Yannick Duchêne (Hibou57)
2011-10-04 21:00   ` Yannick Duchêne (Hibou57)
2011-10-05  1:53     ` Peter C. Chapin
2011-10-05  2:13       ` Yannick Duchêne (Hibou57)
2011-10-05  4:48         ` Jeffrey Carter
2011-10-05  6:21           ` Yannick Duchêne (Hibou57)
2011-10-05  6:39             ` Jeffrey Carter
2011-10-05  5:13         ` Niklas Holsti
2011-10-05  6:33           ` Yannick Duchêne (Hibou57)
2011-10-05  6:45             ` Jeffrey Carter
2011-10-08  1:36             ` Randy Brukardt
2011-10-08  8:39               ` Niklas Holsti
2011-10-08 23:11               ` Yannick Duchêne (Hibou57)
2011-10-06 13:19         ` Peter C. Chapin
2011-10-06 14:01           ` Hyman Rosen
2011-10-08  1:24       ` Randy Brukardt
2011-10-08 13:14         ` Peter C. Chapin
2011-10-08 17:49           ` Jeffrey Carter
2011-10-08 23:55           ` Yannick Duchêne (Hibou57)
2011-10-10 13:31             ` Paul Colin Gloster
2011-10-11  7:45               ` Yannick Duchêne (Hibou57)
2011-10-11  9:40                 ` SPARK and other provers (Was: Re: What's wrong with C++?) Phil Thornley
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox