Apple APIs are infamous for their long names. Not sure what they gain by it
Apple APIs are infamous for their long names. Not sure what they gain by it
builder.makeThing("a", true, true, 46)
[builder makeThingNamed:"a" isRound:YES isRed:YES size:46]
or lately
builder.makeThing(named: "a", isRound:true, isRed:true, size:46)
There is no "kind of true".
> It also increases cognitive load for people who either do already understand the parameters
By letting them see what the parameter they remember is? There's no cognitive load to seeing what you expect.
> or who are doing something for which the parameters are not relevant;
If the language doesn't have optional parameters, all parameters are relevant. By making parameters named, you avoid having to count positional parameters as in MS APIs to ensure you didn't get one in the wrong slot.
> it's harder to ignore a long thing than to ignore a plain "true".
Which is very much valuable. It's much easier to notice mistakes than when you've got 11 positional parameters of which 2/3rds are usually set to 0/null.
Clarity.
It's also a factor of Objective-C's compound methods (inherited from Smalltalk), as each parameter names appears in the method, and which leads to a very phrase-like style.
By osmosis, the C APIs use a similar style.