In particular, isn't Dart (the language described here) one such language? It's been a while since I used it, and I never wrote much, but I at least thought that was the case.
In particular, isn't Dart (the language described here) one such language? It's been a while since I used it, and I never wrote much, but I at least thought that was the case.
Also, reusing names through overloading without providing actual polymorphism, either run time or compile time, is IMO bad, as in I don't get what's there to like. If one open function gets a file name and another gets a username and a password, what's so great in that they have the same name?
Function or method names that postfix the mode onto the verb, like "parse_from_file", are usually an indication that the design could be improved by creating a consistent interface for the various modes. Sometimes it's better to provide a handful of modes, but I always double-check when I see myself writing names like that.
[0] https://en.wikipedia.org/wiki/Schwartzian_transform [1] https://docs.python.org/3/library/functions.html#sorted
Some times, you need parse_from_file, and nothing else. Other times it's worth parametrizing everything and just assembly generic code at the top level.
> If you need a different variant of a method, create a method with a different name. ... type-based overloading is a bad idea, creating brittleness and ambiguity.
All of the cons with it are still there—it really is a hairy feature—but the pros are real too and might be worth doing. We still haven't figured out whether or not we will and, if so, what the exact semantics will be.
This is true, but that's a code smell if the language supports interfaces (I don't know much about Dart, but it appears that Dart does support interfaces).