auto in library functions

Peter Alexander peter.alexander.au at gmail.com
Sun Dec 23 18:13:55 PST 2012


On Sunday, 23 December 2012 at 22:41:56 UTC, Andrej Mitrovic 
wrote:
> You say auto helps with refactoring. I say not using it helps 
> with
> catching bugs. It comes down to a question of what you value 
> more,
> your time while coding, or your time while debugging.

Or even just reading code, which is what programmers spend most 
of their time doing.

When reading code, you want things to be both clear and succinct. 
With long (or inexpressible) type names, using auto makes the 
code more succinct, but for simple types like int, bool, or 
structs/classes with short names, it's far more clear to just use 
the type name.

I don't buy the refactoring argument. Refactoring is rare. 
Refactoring gains are not worth compromising readability.


More information about the Digitalmars-d mailing list