[swift-evolution] When to use argument labels (a new approach)

Dave Abrahams dabrahams at apple.com
Wed Feb 3 19:32:43 CST 2016


on Wed Feb 03 2016, Matt Whiteside <swift-evolution at swift.org> wrote:

> I’m in agreement with what Ricardo is saying here:
>
>> I personally like it and I agree with all except the following:
>> 
>> let p = someFont.glyph("propellor")
>> let p = someFont.glyphWithName("propellor”)
>
> To be more specific, this example looks good to me:
> a.transitionToScene(.GreatHall)               // yes
>
> but this one:
> let p = someFont.glyph("propellor")           // yes
>
> somehow doesn’t.  Maybe because it reads more like subscripting a
> dictionary.  As a result, I think this second example kind of detracts
> from this section of the guidelines.

I wonder if it looks better written like this?

  let p = someFont.glyph("LATIN SMALL LETTER A WITH ACUTE")

"propellor" was the argument in an example of this method in use that I
could find on the web, but it's a really odd way to spell that word.
Maybe it has something to do with that.

-- 
-Dave



More information about the swift-evolution mailing list