<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 2, 2016 at 3:21 PM, Dave Abrahams 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:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">It trims. In this case, it trims whitespace and newlines. I think<br>
that's actually pretty clear.<br></blockquote><div><br></div><div>I wouldn't explain what <font face="monospace, monospace">trimming:</font> does to a new student by just saying 'it trims', because by that explanation it sounds like it mutates its caller. The clarity provided by the verbosity of the old method name will be missed.</div><div><br></div><div>I do appreciate your clarification of how my <span style="font-family:monospace,monospace">updating: </span>example would not meet the new standards, but I find all of the new standards difficult to get right. If 'Proximity' is a type, wouldn't that be truncated because it doesn't communicate semantics? It feels like half of the methods will have clarifying qualifiers, and half won't. I think that will make the language less consistent.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">It is. You just have a different idea about what creates clarity in<br>
source code. IMO, clarity is provided by communicating semantics, *not*<br>
by repeating non-semantic details such as which specific types are in<br>
use. By eliminating words that don't communicate semantics, you make<br>
the semantics clearer. If we didn't believe in this approach, Swift<br>
wouldn't have type inference.<br></blockquote><div><br></div><div>You've solved the repetition of type detail be removing all type detail. That line is clear to you because you already know that .<span style="font-size:13px;color:rgb(80,0,80)">whitespaceAndNewlines </span>is an NSCharacterSet, and that string trims characters instead of something else, like length. There is nothing written on that line of code that tells me what .<span style="font-size:13px;color:rgb(80,0,80)">whitespaceAndNewlines </span>is. It looks like a poorly capitalized enum.</div><div><br></div><div>We don't always read code from within our tools. I can't command-click variables on Stackoverflow, WWDC slides, GitHub. I could read 100 lines of <font face="monospace, monospace">trimming:</font> and still not know that NSCharacterSet exists.</div><div><br></div></div></div></div>