[swift-evolution] [Review] SE-0005 Better Translation of Objective-C APIs Into Swift

Radosław Pietruszewski radexpl at gmail.com
Wed Jan 27 16:43:26 CST 2016


>> 
>> Can I tell, at a call site, whether `respond(data: someData)` is responding with someData, or responding to someData?
>> 
>> That is, can I tell whether someData is the response, or instead is something from the request that the receiver will use to compute the response?
>> 
>> If I see `respondWith(someData)` or `respondWith(data: someData)` or `respondWithData(someData)`, it's clear to me that someData is the response, while a hypothetical call `respondTo(someData)` would tell me that someData is the input to the response-computing algorithm.
> 
> I’d like to reiterate that my preference for cases like these would be:
> 
> 	respond(withData data: Data)
> 
> 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.

That seems very weird.

I’d prefer

   respondWith(data: Data)

to “with” in the label.

(But honestly it seems like an edge case for “with” here to have some meaning aside from just being a separator. Unless there’s a reliable heuristic to differentiate, `respond(data data: Data)` isn’t bad.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160127/08a11245/attachment.html>


More information about the swift-evolution mailing list