<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>I think that this article is one of many great examples of arguments in favor of less explicit typing. These lines of reasoning are often used by proponents of both dynamic languages (like Ruby) and type-inferred languages (like ML or Haskell). C++'s auto is almost exactly like what ML and Haskell have and it's not surprising to me to see bloggers rehash these decades-old arguments.</div><div><br></div><div>But what I like about how we use C++ in WebKit is that we avoid writing English comments, and try to document our code using types, function names, and variable names. Types are a particularly powerful form of documentation because it is checked by the compiler. I think that the main source of my distaste for using auto everywhere is that it takes away our compiler-checked documentation.</div><div><br></div><div>The article seems to suggest that we should say:</div><div><br></div><div> auto x = type { expression };</div><div><br></div><div>when we want documentation. But this is more noisy than saying:</div><div><br></div><div> type x = expression;</div><div><br></div><div>I don't think that the auto-based type expression suggested by the article has any merits over the traditional variable type.</div><div><br></div><div>-Filip</div><div><br></div><br><div><div>On Jan 2, 2014, at 2:31 PM, Brent Fulgham <<a href="mailto:bfulgham@apple.com">bfulgham@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Hi Adam,<br><br>On Jan 2, 2014, at 2:08 PM, Adam Roben <<a href="mailto:aroben@webkit.org">aroben@webkit.org</a>> wrote:<br><br><blockquote type="cite">I found<span class="Apple-converted-space"> </span><a href="http://herbsutter.com/2013/08/12/gotw-94-solution-aaa-style-almost-always-auto/">http://herbsutter.com/2013/08/12/gotw-94-solution-aaa-style-almost-always-auto/</a><br>very persuasive in my thinking about when to use auto.<br></blockquote><br>I think this does a much better job of explaining the benefits of ‘auto’ than I was able to come up with.<br><br>-Brent<br><br>_______________________________________________<br>webkit-dev mailing list<br><a href="mailto:webkit-dev@lists.webkit.org">webkit-dev@lists.webkit.org</a><br><a href="https://lists.webkit.org/mailman/listinfo/webkit-dev">https://lists.webkit.org/mailman/listinfo/webkit-dev</a></div></blockquote></div><br></body></html>