<div dir="ltr">Having so many symbols like @ all over the place kept me from learning and using Ruby and Perl. It just felt wrong and artificial.<div>A language quickly becomes more difficult to learn, use and understand when much of the code consists of symbols.</div><div><br></div><div>I love Swift for having such a simple & clear structure and syntax in most cases. Adding symbols for every instance access on self (which is a very common case) would oppose these benefits and make its learning curve steeper.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 14, 2015 at 8:17 PM, Andrey Tarantsov via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">I agree with Ilya here:<div><br></div><div><div><blockquote type="cite"><div dir="ltr" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span class=""><div>> but they make code editing easier at the expense of readability. <div>Disagree. This really depends on the example. E.g. which is more readable:</div></div><div><br></div></span><span class=""><div> var length: Double { return sqrt(dx*dx + dy*dy) }</div><div><br></div></span><span class=""><div> var length: Double { return sqrt(@dx*@dx + @dy*@dy) }</div><div><div><br></div></div></span><span class=""><div><div> var length: Double { return sqrt(self.dx*self.dx + self.dy*self.dy) }</div></div></span></div></blockquote><br></div><div>I find that this holds true in larger classes as well (or even more). I have tons of view controllers and views that do stuff like:</div><div><br></div><div>obj1.prop1 = X</div><div><div>obj1.prop2 = Y</div><div>...</div><div>obj1.prop10 = Z</div><div>superview1.addSubview(obj1)</div><div><br></div><div>Adding “self.” everywhere adds a significant amount of visual noise; I've tried _property and self.property access styles in Objective-C, and find the former one to be noticeably more readable.</div><div><br></div><div>To be fair, there <i>are</i> cases when it's not immediately clear if something is a property or a variable. That's why you can still add an explicit self. if you want. Some of those are also probably code smells.</div><div><br></div><div>A.</div><div><br></div></div></div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=6ZGE61OxINd5lLe2xYh9Ku-2BXbixWNr2nvfzp2IB1sZgiZ4sgUZp8JJDLPFVR2ifwbHZ9yr9biWLEKCunvODUeO9dDXD5uPVyfoGH4asdPgYxLaZw8-2FBG0v4ZziHU0zoYENu4ypiwrCWdh51ZIU3hV7Rir0r88t3yn39piUl0-2BUMH6emfKetpsT-2FIB43GSjxTsqo5-2FWxHw1jmygI9B5508Dqa3-2FbvLnzv24zimuVU6bQ-3D" alt="" width="1" height="1" border="0" style="min-height:1px!important;width:1px!important;border-width:0!important;margin-top:0!important;margin-bottom:0!important;margin-right:0!important;margin-left:0!important;padding-top:0!important;padding-bottom:0!important;padding-right:0!important;padding-left:0!important">
</div>
<br>_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
<br></blockquote></div><br></div>