• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Swift and parameter names
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Swift and parameter names


  • Subject: Re: Swift and parameter names
  • From: Greg Parker <email@hidden>
  • Date: Mon, 29 Jun 2015 15:50:32 -0700

> On Jun 29, 2015, at 3:42 PM, Rick Mann <email@hidden> wrote:
>
> Here's an example (and this is what I frequently encounter) where requiring parameter names adds nothing but clutter:
>
>    let config = WKWebViewConfiguration()
>    self.webView = WKWebView(frame: self.webViewContainer.frame, configuration: config);
>
> Moreover, when you're skimming the code, it looks a bit like the WKWebView constructor takes four arguments, not two. If you work the way I do, which is to skim pages of code for shapes (e.g., I know the constructor takes two parameters, so I can quickly zero in on a thing that looks like a call with a couple of parameters, delimited by white space, and then look more closely to see if it's the one I wanted. The extra islands of text from parameter names throws that off).

Perhaps you would prefer a different whitespace convention, one with no spaces around the colon in actual parameters. That's a popular convention in Objective-C. Otherwise there is no difference between Objective-C and Swift here.


--
Greg Parker     email@hidden     Runtime Wrangler



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Swift and parameter names
      • From: Rick Mann <email@hidden>
References: 
 >Swift and parameter names (From: Rick Mann <email@hidden>)
 >Re: Swift and parameter names (From: Jens Alfke <email@hidden>)
 >Re: Swift and parameter names (From: Rick Mann <email@hidden>)

  • Prev by Date: Re: Simple Swift question
  • Next by Date: Re: Simple Swift question
  • Previous by thread: Re: Swift and parameter names
  • Next by thread: Re: Swift and parameter names
  • Index(es):
    • Date
    • Thread