[swift-evolution] When to use argument labels, part DEUX (was: when to use argument labels (a new approach))

Tino Heth 2th at gmx.de
Sat Feb 6 12:27:29 CST 2016


It's a very long (and complicated) thread, so I guess the following thought isn't new:

>   a.move(from: b, to: c)
In cases like this, where there are nouns that describe the parameters as good as "from" and "to", so I would call the method

a.moveFile(source: b, destination: c)

("File" is just a placeholder; I think move is to ambiguous)

The advantage of nouns is that they are well suited as variable names as well; the ability to have separate internal and external names is rather exotic, so I think it looks less strange to somebody without an Objective-C/Swift background.

Tino


More information about the swift-evolution mailing list