Phobos examples and auto

Dejan Lekic dejan.lekic at gmail.com
Sat Nov 5 15:41:53 PDT 2011


On Sat, 05 Nov 2011 14:49:11 -0500, Andrei Alexandrescu wrote:

> 
> Sample code should mimic real code. If real code would use auto, sample
> code should use auto.
> 

It is tricky because people have different styles... I try to avoid auto 
as much as possible because I find myself wasting time trying to find out 
what the type actually is. Even in the simplest case - when you see auto, 
you must always look right and try to find what the type is. However, 
when you see <type> <name>, you know immediately what type the <name> 
is... I believe it saves me (and whoever is reading my code) time in the 
long run. I do not mind extra typing. :)


More information about the Digitalmars-d mailing list