asyncAfter(deadline: ...)


(Guillaume Lessard) #1

Hello,

The newer version of the libdispatch overlay (as of 8ac413a) looks good: thanks for your work Matt!

It replaced async(when: ) with asyncAfter(deadline: ); however dictionaries say:

deadline |ˈdedˌlīn|
noun
1 the latest time or date by which something should be completed

dispatch_async’s timestamp is the *earliest* time at which work can be *initiated*, so “deadline” is completely backwards.

If a label is necessary, “time” would seem just fine, given the new name of the function: asyncAfter(time: ).
Personally, I don’t think a label is necessary anymore, since the first parameter of asyncAfter is a timestamp type.

Cheers,
Guillaume Lessard


(Karl) #2

+1

Have been saying this for a while. As have many others sporadically on here.

You are correct that the word “deadline” is the exact opposite of what this parameter means. It’s one of several problems with that particular function, but I got the impression the dispatch team really didn’t take kindly to my input last time and were resolute on their internally-decided name (despite the glaring flaw). So don’t expect anything to happen about it.

···

On 27 Jul 2016, at 10:23, Guillaume Lessard via swift-evolution <swift-evolution@swift.org> wrote:

Hello,

The newer version of the libdispatch overlay (as of 8ac413a) looks good: thanks for your work Matt!

It replaced async(when: ) with asyncAfter(deadline: ); however dictionaries say:

deadline |ˈdedˌlīn|
noun
1 the latest time or date by which something should be completed

dispatch_async’s timestamp is the *earliest* time at which work can be *initiated*, so “deadline” is completely backwards.

If a label is necessary, “time” would seem just fine, given the new name of the function: asyncAfter(time: ).
Personally, I don’t think a label is necessary anymore, since the first parameter of asyncAfter is a timestamp type.

Cheers,
Guillaume Lessard

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution