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

Curt Clifton curt at curtclifton.net
Sun Jan 24 14:29:07 CST 2016


> On Jan 24, 2016, at 11:06 AM, Jacob Bandes-Storch <jtbandes at gmail.com> wrote:
> 
> Just to clarify, are you suggesting that the mutating version would be "applySine()", and the nonmutating version would be "applyingSine()”?

I was thinking `applyingSine()` for the mutating version and just plain old `sin()` for the non-mutating version, or maybe even a computed property, so just `sin`. I’m not really advocating for any of these, but hoping to spur discussion or provide a creative nudge.

Personally, I think I like the `fooInPlace()` convention. It’s unambiguous and sufficiently verbose to perhaps make people think twice about using it.

— Curt


> On Sun, Jan 24, 2016 at 10:50 AM Curt Clifton <curt at omnigroup.com <mailto:curt at omnigroup.com>> wrote:
> 
> On Jan 24, 2016, at 12:34 AM, Jacob Bandes-Storch via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
> 
>> I agree that "sinInPlace()", "meanInPlace()", "remainderInPlace()" seem to work pretty well, but I'm aware that I'm drawing on experience with the old names of sortInPlace(), subtractInPlace(), etc., and in fact this case is worse because the first words aren't really verbs (you can't sine something in place any more than you can sine it). "takeSine()" doesn't sound great either.
> 
> How about "applyingSine()" , "applyingMean()", and "applyingRemainder()"? 
> 
> Cheers, 
> 
> Curt

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160124/90ce3aec/attachment.html>


More information about the swift-evolution mailing list