<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class="webkit-block-placeholder"></div><div class="">There are two considerations which make me skeptical that auto is a good thing.</div><div class=""><br class=""></div><div class="">1. There are many smart pointer types in C++, and ignoring pointer types is very error prone. Others have mentioned std::optional, and mistakes being made with RefPtrs. I even saw a case where a review comment that suggested switching to auto, but it would have introduced memory corruption if followed.</div><div class=""><br class="webkit-block-placeholder"></div><div class="">Some specific cases of this may become irrelevant as PassRefPtr goes away, but I don't think that there is any expectation that smart pointers in general are going away.</div><div class=""><br class=""></div><div class="">2. I also find that types in code are an important part of documenting how it is supposed to work. In a way, these are read-time assertions. An assertion can be wrong and they are compiled out in release builds, yet they prove to be highly valuable anyway. Similarly, a type can be wrong, but it tells me as the reader what the author thinks their code is doing, and lets me focus on other parts of it for the first pass at least.</div><div class=""><br class=""></div><div class="">A very similar kind of type agnostic coding has always been used in templates, and it feels like a well established belief that it takes engineers with high levels of expertise to write generic code in templates. And if it's harder, I don't see why using these techniques all over the place is beneficial.</div><div class=""><br class=""></div><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: 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; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">- Alexey</div><div class=""><br class=""></div></div><br class="Apple-interchange-newline">
</div>
<div><blockquote type="cite" class=""><div class="">11 янв. 2017 г., в 9:15, Darin Adler <<a href="mailto:darin@apple.com" class="">darin@apple.com</a>> написал(а):</div><br class="Apple-interchange-newline"><div class=""><div class="">OK, you didn’t convince me but I can see that your opinions here are strongly held!<br class=""><br class="">— Darin<br class="">_______________________________________________<br class="">webkit-dev mailing list<br class=""><a href="mailto:webkit-dev@lists.webkit.org" class="">webkit-dev@lists.webkit.org</a><br class="">https://lists.webkit.org/mailman/listinfo/webkit-dev<br class=""></div></div></blockquote></div><br class=""><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: 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; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div></div></div></body></html>