auto: useful, annoying or bad practice?

JN 666total at wp.pl
Mon Apr 30 21:21:57 UTC 2018


On Monday, 30 April 2018 at 21:11:07 UTC, Gerald wrote:
> Speaking for myself, I dislike the auto keyword. Some of this 
> is because I have a preference for static languages and I find 
> auto adds ambiguity with little benefit. Additionally, I find 
> it annoying that the phobos documentation relies heavily on 
> auto obscuring return types and making it a bit more difficult 
> to follow what is happening which gives me a bad taste for it.

I'm of the same opinion. I think auto (or var in other languages) 
obscures the types and requires an IDE to reveal what the real 
type is (hopefully the IDE can figure it out). But it seems we 
are in minority. Even Java is adopting auto (called var there) 
and everyone is cheering for that :)


More information about the Digitalmars-d mailing list