[swift-evolution] [Guidelines, First Argument Labels]: Prepositions inside the parens

Radosław Pietruszewski radexpl at gmail.com
Thu Feb 11 17:19:02 CST 2016


> On 12 Feb 2016, at 00:13, Charles Kissinger <crk at akkyra.com> wrote:
> 
> 
>> On Feb 11, 2016, at 2:33 PM, Radosław Pietruszewski <radexpl at gmail.com> wrote:
> [snip]
>> mostly it’s an issue of how initializer/getter-like are named. There’s _a lot_ of method names that are just nouns — which is a large part of the “prepositions being useful” problem.
> 
> I personally don’t have a problem with get… and set… method names, but I doubt that would be popular with the majority.

`get` is usually in the wild as a getter of a property, i.e. taking no parameters. That’s not a problem — you can just skip “get” and there’s generally no confusion. Or just make it a property if possible. The cases I was describing were mostly factories/initializer-like (so I’d suggest “makeFoo” for new APIs), or finder-like (“findTrack”)

— Radek




More information about the swift-evolution mailing list