[swift-evolution] [swift-evolution-announce] [Review] SE-0023 API Design Guidelines

Haravikk swift-evolution at haravikk.com
Sat Jan 23 14:53:16 CST 2016


> On 23 Jan 2016, at 20:19, Dave Abrahams via swift-evolution <swift-evolution at swift.org> wrote:
> 
> 
> on Fri Jan 22 2016, Rob Mayoff <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
> 
> So the question is, which leads to better use-sites?
> 
>  loginAs("mayoff", withPassword: secret)
> 
>  login(username: "mayoff", password: secret)
> 
> ? I think the former wins.
> 
> -- 
> -Dave
> 
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org <mailto:swift-evolution at swift.org>
> https://lists.swift.org/mailman/listinfo/swift-evolution <https://lists.swift.org/mailman/listinfo/swift-evolution>
What about:

login(as: “mayoff”, withPassword: secret)
login(withUsername: “mayoff”, andPassword: secret)

Personally I like the latter, but then I really like AppleScript’s crazy level of natural language style syntax, e.g- set eachDesktop’s picture to theDesktopPicture =D
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160123/86f2fb47/attachment.html>


More information about the swift-evolution mailing list