Hacker News new | ask | show | jobs
by int_19h 411 days 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);
1 comments

Oooh. Nice. I forgot about the Smalltalk / ObjC / Swift usage of keywords for messages.