<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=""><br class=""><div><blockquote type="cite" class=""><div class="">On 27 Jan 2016, at 22:37, Douglas Gregor &lt;<a href="mailto:dgregor@apple.com" class="">dgregor@apple.com</a>&gt; wrote:</div></blockquote><blockquote type="cite" class=""><div class=""><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;" class=""><blockquote type="cite" class=""><div class="">On Jan 27, 2016, at 2:15 PM, Haravikk via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><div class=""><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; 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;"><br class=""></div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; 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;">I’d like to reiterate that my preference for cases like these would be:</div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; 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;"><br class=""></div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; 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;"><span class="Apple-tab-span" style="white-space: pre;">        </span>respond(withData data: Data)</div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; 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;"><br class=""></div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; 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;">This way the action (function name) is still simplified to respond, but the sentence structure remains for clarity, which I still think is the best of both worlds.</div></div></blockquote><br class=""></div><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;" class="">Observation: I’ve never seen anyone write Swift code this way, with a proposition “with” on the first argument label. Have you?</div></div></blockquote><br class=""></div><div>I do ;)</div><div><br class=""></div><div>One thing I really love about Swift’s external names is the ability to make my function calls read a lot like natural language, but in doing so actually clarify how a parameter is used, potentially eliminating the need to consult documentation at all.</div><div><br class=""></div><div>Granted “with” may not be the best word, but in the example it implies to me more that the data itself is being returned, rather than being used to generate some kind of other response, whereas “data” on its own might require me to check to be sure I’ve understand what the function will do with that data.</div><div><br class=""></div><div>For example, I might declare methods like:</div><div><br class=""></div><div><span class="Apple-tab-span" style="white-space:pre"><font face="Monaco" class="">        </font></span><font face="Monaco" class="">func find(theSearchTerm needle:String, inTheString haystack:String) -&gt; Range&lt;String.Index&gt;</font></div><div><font face="Monaco" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>let match =&nbsp;matcher.find(</font><span style="font-family: Monaco;" class="">theSearchTerm</span><font face="Monaco" class="">: “find me”,&nbsp;</font><span style="font-family: Monaco;" class="">inTheString</span><font face="Monaco" class="">: “see if you can find me in this”)</font></div><div><br class=""></div><div>Still might not be the best example but hopefully it gives you the idea. Sometimes there’s verbosity for the sake of maintaining the pattern, but the idea is to end up with self-documenting function declarations. Of course I had SwiftDoc anyway for clarity and because I’m an habitual documenter, but if a function can be understood purely from how it’s used then that’s a good thing IMO. I should mention I’m a huge fan of Applescript’s syntax (though I hate its performance).</div><div><br class=""></div><div>Of course I realise we’re talking about converting Objective-C functions, but while I don’t like the overly long function names (I prefer functions with a similar action to have the same name) I do like that some of them are self-documenting thanks to the added verbosity, and I’m just concerned that we might lose some of that, as personally I try to keep my functions fairly descriptive in my own code.</div></body></html>