• 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: Rick Mann <email@hidden>
  • Date: Mon, 29 Jun 2015 15:42:41 -0700

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);

If Code Completion worked 100% of the time, and responded in a millisecond, I might be able to get by using its reminders. But it fails to complete at least half the time for me, and take several hundred milliseconds to display options (I invoke it with a keystroke, I don't wait for the timer), and it often displays many more options than I need.

I can't remember when a parameter name is required. So I write it without, then attempt to compile, then get told it's missing the "frame" name, so I add that, then figure I gotta add the config parameter, but I couldn't remember if it was config or configuration, so I had to wait for code completion, etc.

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).

This happens ALL THE TIME. How often it happens that I really wish someone had named an unnamed parameter is never.

--
Rick Mann
email@hidden



_______________________________________________

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: Quincey Morris <email@hidden>
    • Re: Swift and parameter names
      • From: Quincey Morris <email@hidden>
    • Re: Swift and parameter names
      • From: Greg Parker <email@hidden>
References: 
 >Swift and parameter names (From: Rick Mann <email@hidden>)
 >Re: Swift and parameter names (From: Jens Alfke <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