auto, var, raii,scope, banana

kris foo at bar.com
Tue Jul 25 11:53:11 PDT 2006


Nils Hensel wrote:
> kris schrieb:
> 
>> Don has a good point: changing to "var" would cause conflict with 
>> existing variable-names.
> 
> 
> I'm sorry but I don't believe there are many programmers out there 
> actually using something as undescriptive as "var" as a regular 
> identifier. I also strongly believe that no one should. It's the 
> implication of a maintenance nightmare.
> I don't intend to insult Don in any way but it's a horrible practice 
> IMNSHO that should not be preserved.
> 
> So let's not focus on some odd minority but rather on the wide use of 
> "var" in the context of type inference and dynamic typing.
> 
> Also I don't think that it's a good habit to be looking at how C++ does 
> something unless one is looking for a bad example. My main reason for 
> interest in D is because personally I'm fed up with C++ and consider it 
> an abomination and a major PITA.
> 
> Just my 0.02 EUROs,
> 
> Nils


Well, it would have notable impact on existing code to change auto to 
var. They're at least equally clear in my view, so it would come down to 
a question of impact upon existing code.

What's more important is the clarification of what "auto" means. Right 
now, it's somewhat confused (with raii). If we instead use "scope" to 
indicate raii, that confusion just goes away.

Besides, "scope" is a fine attribute for things that are "scoped" :)



More information about the Digitalmars-d mailing list