News for hackers. Stuff that matters.
Re:The C++14 Standard: What You Need to Know by Ragnarork on Wednesday September 17, 2014 @10:09AM (#8330010)
In fact, with an IDE, this argument is moot. You can have the type anyway.

Then, we do use template parameters already, for which we usually don't know the type. I can't see why we'd bitch about 'auto' and not about the template parameters.

It's just the same thing: coding against interfaces and not implementations.

Re:The C++14 Standard: What You Need to Know by millstone on Thursday September 18, 2014 @01:17AM (#8333839)
A key difference is that we are being told to use auto (but not templates) gratuitously, even when there's only one possible type.

I prefer to make functions ordinary, and only templatize functions that need to operate on more than one type. There's good reasons for this: the compiler is less effective at type-checking templates, they require the function body to be visible, and they may fail to warn you when passed the wrong type.

"auto" suffers from all those problems, and yet we are being told to use it whenever possible. That's bad advice.

Re:The C++14 Standard: What You Need to Know by JoeAltmaier on Wednesday September 17, 2014 @10:10AM (#8330023)
Template is explicit; auto can sneak under your radar and look like things you already think you know how they work. Any change to the mainstream syntax can be troublesome at first.
Re:The C++14 Standard: What You Need to Know by Ragnarork on Wednesday September 17, 2014 @10:20AM (#8330072)
I don't see how auto is less explicit than a template when it comes to involving implicit interfaces.