<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="">On Jun 20, 2016, at 10:12 PM, Xiaodi Wu <<a href="mailto:xiaodi.wu@gmail.com" class="">xiaodi.wu@gmail.com</a>> wrote:<br class=""><div><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote">On Mon, Jun 20, 2016 at 9:05 PM, Brent Royal-Gordon via swift-evolution <span dir="ltr" class=""><<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">> DispatchQueue.async(execute:) and DispatchQueue.sync(execute:)<br class="">
> --------------------------------------------------------------<br class="">
> The lack of verb in the base name bothers me. The API Design Guidelines say “methods with side-effects should read as imperative verb phrases”. You could argue that the argument label “execute” serves as the verb. However, .async and .sync are most commonly used with trailing closures where the argument label is not present.<br class="">
><br class="">
> This issue was brought up during the review, but I did not see it being addressed. Why not name the methods something like .executeAsync(_:) and .executeSync(_:)?<br class="">
<br class="">
</span>That feels a little redundant to me. It's worth remembering that the API Guidelines are a means of creating clear APIs, not an end in themselves. It's okay to deviate a little if you get a better result.<br class=""></blockquote><div class=""><br class=""></div><div class="">The guideline that methods should "read as imperative verb phrases" applies to the full name, labels and arguments and all, and not just the base name. You'll recall that the original proposal had .asynchronously(execute:), which is very much an imperative phrase. `.async(execute:)` was substituted by popular demand, with "async" being regarded as a term-of-art exception.</div></div></div></div></div></blockquote><br class=""></div><div>Can you link me something that says it applies to the full name? In all the examples, the verb is always in the base name and the argument labels are always prepositions or objects (the grammar version).</div><div><br class=""></div><div>And what about when a trailing closure is used? Then the verb disappears.</div></body></html>