On Jan 3, 2014, at 10:11 AM, Alexey Proskuryakov <[email protected]> wrote:
> I'm not Geoff, yet I'd like to offer my perspective on the specific examples > you provided. > > 03 янв. 2014 г., в 4:12, Antti Koivisto <[email protected]> написал(а): > >> auto& cell = toRenderTableCell(*renderer); // right >> RenderTableCell& cell = toRenderTableCell(*renderer); // wrong > > I can't agree with this example. With auto, I don't know if it's a raw > pointer, a reference, or a smart pointer (we have toXXX functions that return > all of those). I also cannot Cmd+click on anything to go to the class > definition, and when I Cmd-click on toRenderTableCell, I presumably get into > some unreadable macro. > > Overall, auto makes the code very opaque here. I agree. I think use of auto makes code you’re unfamiliar with much harder to follow, and makes getting to the type declaration one more Command-click away. Better tools integration would help; if I could hover over the “auto” had have Xcode show me, in a tooltip, what type the compiler will infer, then I’d be more willing to see wider use of auto. Simon
_______________________________________________ webkit-dev mailing list [email protected] https://lists.webkit.org/mailman/listinfo/webkit-dev

