[swift-evolution] [Review] SE-0088: Modernize libdispatch for Swift 3 naming conventions

James Dempsey dempsey at mac.com
Wed May 11 08:32:09 CDT 2016


My main piece of feedback is that the method names synchronously() and asynchronously() don’t conform to Swift 3 naming conventions for functions and methods:

"Name functions and methods according to their side-effects

	• Those without side-effects should read as noun phrases, e.g. x.distance(to: y), i.successor().

	• Those with side-effects should read as imperative verb phrases, e.g., print(x), x.sort(), x.append(y).”

The method names

	synchronously()
	asynchronously() 

are both adverbs, not noun phrases or verb phrases.
These methods have side effects, so each name should have a verb in it to make it a verb phrase.


Since these are the methods where you actually dispatch a block into a queue

dispatchSynchronously()
dispatchAsynchronously()

would include the verb in the name of the methods.


Since the majority of uses of GCD is for async dispatch, you could possibly make async the ‘default' and have the two names be:

dispatch() // Dispatches Asynchronously
dispatchSynchronously()


You could potentially make the case that ’sync’ and ‘async’ are well-known terms in their own right, not just abbreviations, and use them instead of the longer words:

dispatchAsynch()
dispatchSynch()


James




> On May 10, 2016, at 9:39 PM, Chris Lattner via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Hello Swift community,
> 
> The review of "SE-0088: Modernize libdispatch for Swift 3 naming conventions" begins now and runs through May 17. The proposal is available here:
> 
> 	https://github.com/apple/swift-evolution/blob/master/proposals/0088-libdispatch-for-swift3.md
> 
> Reviews are an important part of the Swift evolution process. All reviews should be sent to the swift-evolution mailing list at
> 
> 	https://lists.swift.org/mailman/listinfo/swift-evolution
> 
> or, if you would like to keep your feedback private, directly to the review manager.
> 
> What goes into a review?
> 
> The goal of the review process is to improve the proposal under review through constructive criticism and contribute to the direction of Swift. When writing your review, here are some questions you might want to answer in your review:
> 
> 	* What is your evaluation of the proposal?
> 	* Is the problem being addressed significant enough to warrant a change to Swift?
> 	* Does this proposal fit well with the feel and direction of Swift?
> 	* If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?
> 	* How much effort did you put into your review? A glance, a quick reading, or an in-depth study?
> 
> More information about the Swift evolution process is available at
> 
> 	https://github.com/apple/swift-evolution/blob/master/process.md
> 
> Thank you,
> 
> -Chris Lattner
> Review Manager
> 
> 
> 
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160511/6f5bdf5a/attachment.html>


More information about the swift-evolution mailing list