<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;">Hi Filip,<div><br><div><div>Coming back to your earlier example:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-family: Helvetica; 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;"><div> auto newSize = optimalSize();</div><div dir="auto">vs:</div></div></blockquote><blockquote type="cite"><div style="font-family: Helvetica; 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;"><div dir="auto"> CGSize newSize = optimalSize();</div></div></blockquote><br></div><div>If I understand your argument, you feel that the explicit CGSize declaration helps the reader because it makes the return value of optimalSize() explicit.</div><div><br></div><div>However, that declaration is only stating the type that the author *thinks* optimalSize() returns. There is nothing to guarantee that optimalSize() returns a CGSize; only that it returns something that the compiler can turn into a CGSize through some set of casts.</div><div><br></div><div>The code stating CGSize could have been correct at one point, but the return type of optimalSize might have been changed to some similar type without anyone noticing.</div><div><br></div><div>Using ‘auto’ doesn’t seem to make this situation any worse.</div><div><br></div><div>In fact, although Sutter’s suggestion of:</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>auto newSize = CGSize { optimalSize(); }</div><div><br></div><div>looks gross to my eye, it might be a useful approach because it would force the compiler to complain if we were returning something that was not explicitely a CGSize type.</div><div><br></div><div>-Brent</div><div><br></div><br></div></body></html>