Re: Swift and parameter names
Re: Swift and parameter names
- Subject: Re: Swift and parameter names
- From: Marco S Hyman <email@hidden>
- Date: Wed, 24 Jun 2015 16:37:05 -0700
On Jun 24, 2015, at 4:09 PM, Rick Mann <email@hidden> wrote:
>
> I guess I disagree: it's obvious in most cases. Again, I'm just arguing for the OPTION. You can always choose to use the parameter name if you wish.
You have the option. Given this signature:
func foo(intArg: Int, stringArg: String) -> Bool { ... }
add this code to call the function without named arguments.
func foo(intArg: Int, _ stringArg: String) -> Bool {
return foo(intArg, stringArg: stringArg)
}
Now you can call it either way.
I like that I do NOT have the ability to mix and match calling conventions
by accident which could possibly confuse code readers. Especially when I am
the code reader! If I really need the the option to do mix styles adding
code such as that above wouldn’t be an issue.
Marc
_______________________________________________
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