<div dir="ltr">On 14 November 2017 at 21:36, Mike Kluev <span dir="ltr">&lt;<a href="mailto:mike.kluev@gmail.com" target="_blank">mike.kluev@gmail.com</a>&gt;</span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote"><div>it might cover well over 90% of use cases (by my &quot;pessimistic&quot; estimate)... if someone has a quick way to scan and analyse, say, github swift sources we may even know that current percentage number of real life usage.</div></div></div></div>
</blockquote></div></div><div class="gmail_extra"><br></div><div class="gmail_extra">i did a quick &amp; dirty search on github (queries below). here are some stats:</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">1) &quot;weak var&quot; - 946K hits<br></div></div><div class="gmail_extra"><div class="gmail_extra"><br></div><div class="gmail_extra">2) &quot;weak self&quot; - 168K hits</div><div class="gmail_extra"><br></div><div class="gmail_extra">3) &quot;weak&quot; - 1127K hits</div><div class="gmail_extra"><br></div><div class="gmail_extra">the summ of &quot;weak var&quot; + &quot;weak self&quot; = 1114K hits</div><div class="gmail_extra"><br></div><div class="gmail_extra">number of &quot;weak&quot; - 1114K = 13K</div><div class="gmail_extra"><br></div><div class="gmail_extra">let&#39;s assume this 13K is for weak &quot;something&quot; which is not &quot;self&quot;</div><div class="gmail_extra"><br></div><div class="gmail_extra">number of &quot;weak something&quot; + &quot;weak self&quot; = 181K</div><div class="gmail_extra"><br></div><div class="gmail_extra">&quot;weak self&quot; = 168K / 181K = 93%</div><div class="gmail_extra"><br></div><div class="gmail_extra">&quot;weak something&quot; = 13K / 181K = 7%</div><div class="gmail_extra"><br></div><div class="gmail_extra">the search queries for those interested:</div><div class="gmail_extra"><br></div><div class="gmail_extra"><a href="https://github.com/search?utf8=%E2%9C%93&amp;q=%22weak+var%22+filename%3A.swift&amp;type=Code">https://github.com/search?utf8=✓&amp;q=%22weak+var%22+filename%3A.swift&amp;type=Code</a></div><div class="gmail_extra"><a href="https://github.com/search?utf8=%E2%9C%93&amp;q=%22weak+self%22+filename%3A.swift&amp;type=Code">https://github.com/search?utf8=✓&amp;q=%22weak+self%22+filename%3A.swift&amp;type=Code</a></div><div class="gmail_extra"><a href="https://github.com/search?utf8=%E2%9C%93&amp;q=%22weak%22+filename%3A.swift&amp;type=Code">https://github.com/search?utf8=✓&amp;q=%22weak%22+filename%3A.swift&amp;type=Code</a></div><div class="gmail_extra"><br></div><div class="gmail_extra">note that you have to rerun the search multiple times until it settles around some number.</div><div class="gmail_extra">also note, you can&#39;t easily use [ ] or other punctuation in github builtin search.</div><div class="gmail_extra"><br></div><div class="gmail_extra">the stat suggests that in 90%+ real-life cases [weak self] is used so the &quot;weak func&quot; syntax sugar is worth to consider as an addition to this proposal.</div><div class="gmail_extra"><br></div><div>Mike</div><div><br></div></div></div>