[swift-evolution] swift-evolution Digest, Vol 3, Issue 7
Dave Abrahams
dabrahams at apple.com
Wed Feb 3 18:30:36 CST 2016
on Wed Feb 03 2016, Andrew Duncan <swift-evolution at swift.org> wrote:
> On 2 Feb, 2016, at 8:41, dabrahams at apple.com wrote:
>>
>>>
>>> * I also agree with Radosław in that I prefer `removeAll(keepCapacity:
>>> Bool)` to `removeAll(keepingCapacity: Bool)`.
>>
>> Why?
>>
>> I had a hard time justifying "keeping" to myself for a while, but
>> eventually I realized that this pattern is less ambiguous, at least in
>> general, since many verbs are also nouns.
> ^^^^^^^^^^^^^^^^^^^^^^^^^
>
> This is one of my real bugbears. I think we should call this out
> explicitly somewhere in the guidelines. Consider something like
> “updatePostThread”. (This does come from real life, and occasioned
> some bad words.) All three words: “update”, “post”, and “thread” are
> *both* noun and verb. This means that (theoretically) there could be 8
> different interpretations.
>
> I suggest a guideline that recommends avoiding verb-noun words in
> favor of ones that are only a noun or only a verb.
I'm really wary of calling out every possible source of ambiguity in the
guidelines, but this one might fit well into the “Special Instructions”
section.
--
-Dave
More information about the swift-evolution
mailing list