A better example would be "Join" - look at String.Join and
Thread.Join.
They are radically different operations with the same name. I certainly
wouldn't view those as polymorphically related, even though Smalltalk
would. No doubt Smalltalkers would argue that they're definitely
related *because* they share the same name, but until natural language
becomes completely unambiguous, I think it's a bad way of implying
relationship.
String.Join and Thread.Join are a great example. (I was trying to come
up with an example like that... thanks, Jon.)
This is starting to look more and more like the "strongly typed
language" versus the "weakly typed language" debate, isn't it? It's
like the discussion between VB6 programmers, who are used to having an
"anything" type that they can just stuff values into, and C++
programmers who are used to the rigour of having to declare everything
and be concerned with casting and type conversions. The VB6 guys I knew
used to laugh at C++ and all of the picky housekeeping details you had
to look after in that language; the C++ used to sniff at the VB6 guys
and all of the bugs that cropped up because you inexplicably ended up
with a bitmap in a variable you thought contained an integer.
It strikes me that Smalltalk implements what I would call "weakly typed
polymorphism": same name = same operation. The upside is that you don't
have to worry about picky housekeeping details: the language sorts it
out at runtime. The downside is that you get polymorphism even when it
isn't appropriate and you don't want it, allowing you to do stupid
things like confuse concatenating two strings (String.Join) with
waiting for a thread to complete (Thread.Join). C++, Java, and C# all
implement what I would call "strongly typed polymorphism", where the
programmer has to explicitly indicate that he wants polymorphism, and
keep careful track of what overrides what. The upside is that you get
polymorphism only where you explicitly indicate it; the downside is
that there is lots of picky housekeeping to do.
The fact that both strongly-typed and weakly-typed languages continue
to flourish tells me that each has something to offer. I would say the
same with the two approaches to polymorphism.
I should add that given the mandate of the .NET Framework and C#,
weakly-typed polymorphism seems to me to be a total non-starter in this
environment. The C# / .NET designers took great pains to ensure that
you couldn't possibly introduce rogue code that would override and
redefine things in order to create security holes, or in order to take
over threads for nefarious purposes. I'm not sure how you would mix
that kind of locked-down rigour with a language that sorts out its
polymorphism issues at run-time. They seem like oil and water to me,
although that may just be lack of imagination on my part.
