|
![](/i/fill.gif) |
On 8/13/2012 9:22, Orchid Win7 v1 wrote:
> Weirdly, both Java and C# actually /allow/ interfaces to inherit, thus
> defeating the whole point of the exercise.
Diamond inheritance isn't a problem if you don't have implementations.
OK, so Thread declares void run(), and DistressedDamsel declares void run().
Why would those declarations conflict?
> It makes little to no sense in C#, a language which is already doomed to be
> horrifyingly inefficient before you've even written a single line of code.
It's becuase C# is a component-oriented language. It's designed to let
people write code and release the object code and have others use it without
recompiling.
It's also not intrinsically inefficient. For example, Singularity uses it to
write its kernels in.
> Arguably you could have the compiler detect where dynamic binding is and is
> not needed. That requires whole-program analysis, however.
That's what Eiffel does.
> No problem for
> Haskell, but C# explicitly supports run-time loading of additional code, so
> there's no telling at compile-time what external code might do.
Sure there is, because you recompile the code while it's running.
> Yeah, I don't know. I'm slowly coming around to the idea that maybe we
> should forget about all this "inheritance" stuff and focus on interfaces as
> the primary thing of interest...
I kind of like where Go went: static duck typing.
--
Darren New, San Diego CA, USA (PST)
"Oh no! We're out of code juice!"
"Don't panic. There's beans and filters
in the cabinet."
Post a reply to this message
|
![](/i/fill.gif) |