On Tue, Nov 28, 2017, at 11:45 AM, Eric Rescorla wrote: > On Mon, Nov 27, 2017 at 4:07 PM, smaug <sm...@welho.com> wrote: > > And auto makes code reading harder. It hides important information like > > lifetime management. > > It happens easily with auto that one doesn't even start to think whether > > nsCOMPtr/RefPtr should be used there. > > This statement seems perhaps a touch to universalist; it may be the case > that it makes it harder for *you* to read, but I find it makes it easier > for me to read. I also don't think it's a coincidence that it's a common > feature of modern languages (Rust and Go, to name just two), so I suspect > I'm not alone in thinking auto is a good thing.
Using Rust and Go as examples isn't very fair. Go has GC, and Rust has compile-time lifetime checking, so they are basically free from certain kind of lifetime issues. There are features in Rust that can easily become footgun when used with C++, one example is std::string_view. [1] [1] https://github.com/isocpp/CppCoreGuidelines/issues/1038 - Xidorn _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform