<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=""><div class="">+1 to naming like this. dispatch() and dispatchSynchronously() if needed to please thy naming gods.</div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On 13 May 2016, at 4:16 AM, Thorsten Seitz via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">dispatch() and dispatchSync() would be my preference as asynchronous dispatch is the point of GCD and synchronous dispatch is a special case and therefore I think the visual asymmetry is an advantage.<div class=""><br class=""></div><div class="">-Thorsten</div><div class=""><br class=""></div><div class=""><br class=""><div class=""><div class=""><blockquote type="cite" class=""><div class="">Am 12.05.2016 um 20:10 schrieb James Dempsey via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>>:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On May 11, 2016, at 8:02 PM, Ricardo Parada <<a href="mailto:rparada@mac.com" class="">rparada@mac.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="content-type" content="text/html; charset=utf-8" class=""><div dir="auto" class=""><div class=""><br class=""><br class="">For synchronously and asynchronously how about the adverbs before the verb:</div><div class=""><br class=""></div><div class="">syncDispatch()</div><div class="">asyncDispatch()</div></div></div></blockquote><div class=""><br class=""></div><div class=""><br class=""></div><div class="">I think with the abbreviation ‘sync’ it’s very easy to read ‘sync’ as a verb and dispatch as a noun.</div><div class=""><br class=""></div><div class="">i.e. I’m going to sync up with you about our plan</div><div class="">i.e. I received a dispatch from headquarters</div><div class=""><br class=""></div><div class="">I would be very fine with</div><div class=""><br class=""></div><div class="">dispatchAsync() and dispatchSync() as method names.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><blockquote type="cite" class=""><div class=""><div dir="auto" class=""><div class=""><br class=""></div><div class="">?</div><div class=""><br class="">On May 11, 2016, at 10:50 AM, James Dempsey <<a href="mailto:dempsey@mac.com" class="">dempsey@mac.com</a>> wrote:<br class=""><br class=""></div><blockquote type="cite" class=""><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div class=""><blockquote type="cite" class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class="">So maybe that will conform to the API naming guideline? Or would the verb have to be in the base name of the func?</div></div></blockquote></div><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><br class=""></div><div class="">It seems from the guidelines that the intent is for the verb to be in the base name of the func, especially since there is another set of guidelines for naming function parameters.</div><div class=""><br class=""></div><div class="">In general the other methods in the proposal are verbs (perform(), notify(), wait(), cancel(), etc.)</div><div class=""><br class=""></div><div class="">At least for me, not including a verb makes the API read like the sentence “The dog quickly”. This wasn’t so bad in the C API, because you could read the word ‘dispatch’ as the verb.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Looking at the current GDC API, it does seem like dispatching synchronously is the rare and special case.</div><div class=""><br class=""></div><div class="">Could there be just a single dispatch() method, with async as a flag with a default value of true?</div><div class=""><br class=""></div><div class="">It might be a little ugly because most of the other parameters of the proposed asynchronously() method would not apply in the sync case.</div><div class=""><br class=""></div><div class="">James</div><div class=""><br class=""></div><div class=""><br class=""></div></div></div><br class=""><div class=""><blockquote type="cite" class=""><div class="">On May 11, 2016, at 7:14 AM, Ricardo Parada <<a href="mailto:rparada@mac.com" class="">rparada@mac.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Jacob Bandes-Storch suggested:<div class=""><br class=""></div><div class=""><font face="Consolas" class="">synchronously(execute work: …)</font></div><div class=""><br class=""></div><div class="">So maybe that will conform to the API naming guideline? Or would the verb have to be in the base name of the func?</div><div class=""><br class=""></div><div class="">Or perhaps:</div><div class=""><br class=""></div><div class=""><div class=""><font face="Consolas" class="">synchronously(dispatch work: …)</font></div><div class=""><div class=""><font face="Consolas" class="">asynchronously(dispatch work: …)</font></div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><blockquote type="cite" class=""><div class="">On May 11, 2016, at 9:32 AM, James Dempsey via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">The method names</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>synchronously()</div><div class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>asynchronously() </div><div class=""><br class=""></div><div class="">are both adverbs, not noun phrases or verb phrases.</div><div class="">These methods have side effects, so each name should have a verb in it to make it a verb phrase.</div><div class=""><br class=""></div><br class=""><div class=""><div class="" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: 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;">Since these are the methods where you actually dispatch a block into a queue</div><div class="" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: 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: 14px; font-style: normal; font-variant-caps: 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;">dispatchSynchronously()</div><div class="" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: 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;">dispatchAsynchronously()</div><div class="" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: 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: 14px; font-style: normal; font-variant-caps: 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;">would include the verb in the name of the methods.</div><br class="Apple-interchange-newline"></div></div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></div></blockquote></div></div></blockquote></div><br class=""></div>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></blockquote></div><br class=""></div></div></div>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></body></html>