re: Why self is not this in Python! VIEW POST

re: I never experienced this kind of pain and I'm using Next Generation Shell (with multiple dispatch) for years now. function (x:Person, y:Animal, z...

If NGS allows default arguments, then it may be OK. Julia, as far as I know, uses multiple dispatch and its users are happy. Recently, I run into a nasty problem with an overloaded method in C#, where I had to supply an argument I did not care for because the overloading did not cover my use case.

Still, I am not convinced that multiple dispatch is a good design for a modern language. But I may be wrong, of course. The language I have on my mind differs heavily from everything I've seen so far.

I took the example from wiki and thinking about it, even the example itself is crippled and code smell on its own. Actually, instead of using signature with types, much simpler and more correct would be just to rely on interfaces or traits.

So instead

function(x: Animal, y:Person, z: integer)

Would be just one

function(x: CommonTraitForAnimalAndPerson, y: CommonTraitForAnimalAndPerson, z: integer)

This one is actually more concise and general than any previous solution.

code of conduct - report abuse