|
|
|
|
|
by DagAgren
2202 days ago
|
|
> and Swift is particularly weird. The way Swift does them is the least awkward and most robust I have seen in any language. > As an example, the colon and the whitespace are sufficient to separate parameters. So is the comma. So we have...both? Designing a language around what the minimum requirements of a parser is will not get you a good language. Human language is massively redundant, because humans find it more easy to communicate when there is redundancy. Computer code is also communication aimed at humans, and a bit of redundancy does not hurt there, and can often help. > There is also the issue that, please correct me if I got this wrong, the label that's in the signature becomes the name of the parameter inside the function. This is incorrect. You can optionally specify both an internal and external name for any argument. Unlabelled arguments are just a special case of this syntax, where you say "external name does not exist, internal name is this". |
|