On 18-06-15 11:31, smaug wrote:

>> One common "auto" usage I've seen is for storing the result of a
>> static_cast<>.  In this scenario, it lets you avoid repeating yourself
>> and makes for more concise code.
> 
> It still hurts readability.
> Whenever a variable is declared using auto as type, it forces reader to
> read the part after '='.
> So, when reading code below some "auto foo = ...", in order to check
> again the type of foo, one needs to
> read the "= ..." part.

I disagree it hurts readability. Repeating the exact same thing twice
does not make things more readable IMHO. In your example you're forced
to read the part right of = but that's 1) *instead of* reading the more
complicated LHS 2) likely what you had to do anyway.

FWIW:
https://google-styleguide.googlecode.com/svn/trunk/cppguide.html#auto

-- 
GCP
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to