Arne VajhHj wrote:
Lew wrote:
I suggest that people read the article at
<http://java.sun.com/docs/white/delegates.html>
for themselves, and then read up on C# delegates and think about
the
issues for themselves.
I'm not saying I agree with Sun's reasoning, but it's clear from it
that they exercised the human capacity for rational thinking before
deciding whether to include delegates in the Java language.
I don't think their arguments are very valid.
Delegates is a nice feature in C# and does not seem to have
any side effect when we look at it from the practical perspective.
The *only* valid argument I can see against delegates is the
size of the language: more languages features does not make a
language better - just ensure it has the same future as PL/I and
Ada.
But if you add delegates, you remove the need for inner classes to
implement callbacks. (Nested classes could be retained as
code-structuring devices, but the notion of owning instance can go.)
To my mind, delegates are much simpler than inner classes, so this is
a net gain in simplicity.
You can never remove features from a language.
The curse of compatibility.