<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Feb 17, 2016 at 5:43 PM, Dave Abrahams <span dir="ltr"><<a href="mailto:dabrahams@apple.com" target="_blank">dabrahams@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
on Wed Feb 17 2016, Jacob Bandes-Storch <jtbandes-AT-gmail.com> wrote:<br>
<br>
> On Wed, Feb 17, 2016 at 3:49 PM, Dave Abrahams via swift-evolution <<br>
> <a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br>
><br>
>><br>
>> on Wed Feb 17 2016, Jacob Bandes-Storch <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br>
>><br>
>> > Question about how to interpret/apply the guidelines:<br>
>> ><br>
>> > "[functions/methods] without side-effects should read as noun<br>
>> phrases…"<br>
>> > "Use the “ed/ing” rule to name the nonmutating counterpart of a<br>
>> > mutating method…"<br>
>> > "The names of other types, properties, variables, and constants<br>
>> should<br>
>> > read as nouns."<br>
>> ><br>
>> > Within these guidelines, how do we explain why<br>
>> > *-stringByExpandingTildeInPath* becomes "var *expandingTildeInPath*"? I'm<br>
>> > wondering if the guidelines should clarify that the "ed/ing rule" may<br>
>> apply<br>
>> > to more than just nonmutating methods with mutating counterparts.<br>
>><br>
>> Why should it?<br>
>><br>
><br>
> Otherwise, it seems a case like this isn't really covered by the guidelines.<br>
><br>
>><br>
>> > I think that "var expandingTildeInPath" is probably the best choice for<br>
>> > this API, but I can't figure out how to reconcile it with the guidelines<br>
>> as<br>
>> > written.<br>
>><br>
>> The guidelines don't force you to spell it that way, but they allow it.<br>
>><br>
>> “x, expanding the tilde in its path”<br>
>><br>
>> is a noun phrase.<br>
>><br>
><br>
> OK, I see. I guess what's confusing me is that I'm not sure why both the<br>
> "ed/ing rule" and "read as noun" guidelines need to exist.<br>
<br>
</div></div>Because many methods are like:<br>
<br>
x.tracks(havingTitle: "foo")<br>
<br>
That reads as a noun phrase, but is not an "ed" or "ing". The reason<br>
for "ed"/"ing" is to maintain a name association between a method that<br>
forms a verb phrase at the call site (the mutating one) and a method<br>
that forms a noun phrase at the call site.<br>
<span class=""><br>
> Maybe it would be clearer if the sentence were something like "The names of<br>
</span>> other types, properties, variables, and constants should read as nouns *at<br>
> the point of use (possibly including the receiver in the noun phrase)*."<br>
<br>
I don't believe that's needed. The guidelines consistently and<br>
repeatedly emphasize use sites, and I can't think of an invocation that<br>
reads as a noun phrase with the receiver but doesn't without. Can you?<br></blockquote><div><br></div><div>I'll have to think about it more. I'm trying to figure out why this seems incomplete/confusing to me in some cases. "expandingTilde" doesn't "feel like" a noun to me, but probably just because I'm not a linguist.</div><div><br></div><div>Also, you could infer "x.expanding..." alone to mean "x, <b>by</b> expanding..." or "<b>whether </b>x <b>is</b> expanding...", so there might be some cases where it's easy to confuse Bool properties with non-Bools.</div><div><br></div><div><br></div></div></div></div>