Phobos examples and auto

dsimcha dsimcha at yahoo.com
Sat Nov 5 15:56:43 PDT 2011


On 11/5/2011 6:48 PM, Andrei Alexandrescu wrote:
> Most everyone agrees that sometimes specifying a type, even if
> redundant, is helpful. There are people who think those cases form all
> or a majority of all instances (and hence auto should be avoided), but I
> have reasons to believe they're a minority.
>
> Andrei

I tend to agree with Andrei here.  I'm a bit biased, though, because 
before I started using D most of my experience was in dynamic, 
duck-typed languages.  To me, the nominal type of something doesn't 
really mean much.  Occasionally it's useful to see a type explicitly 
specified when there's a specific reason why it needs to be emphasized 
for clarity.  On the other hand, languages like Python, Ruby, PHP and 
Perl argue very strongly that we could move even further away from 
explicit type declarations and still have a usable language.


More information about the Digitalmars-d mailing list