3 ms·
They aren't even necessarily redundant. If you have argument names as part of the function name, they can be overloaded on - and this is much more readable than
by int_19h 2y ago
They aren't even necessarily redundant. If you have argument names as part of the function name, they can be overloaded on - and this is much more readable than type-based overloading because it's all explicit. Swift uses this to great effect, e.g. here are some different ways to construct a string:
String(repeating: "foo", count: 42);
String(cString: zeroTerminatedBuffer);
String(42, radix: 16);
String(contentsOfFile: "foo.txt", encoding: .utf8);
- bsder 2y agoOooh. Nice. I forgot about the Smalltalk / ObjC / Swift usage of keywords for messages.