To view parent comment, click here.
To read all comments associated with this story, please click here.
Delegates have brilliant compiler support in C#. The helper classes are created invisibly by the compiler.
Regarding generics; from what I heard Java cheated there. It's "just" a compile time check so the type casting has to be done anyway.
Virtual and override are there for the same reason as C++ I guess. On non-virtual functions you don't go thru a function pointer in vtab.
I like the out things for arguments to a function. More to write but thats a cheap price for potential bugs.
Coming from C++ I was btw a bit disappointed at both languages when I realized generics is just about avoiding typecasts. On the other hand, I haven't seen a compiler so far that deals properly with templates. So perhaps it was an ok tradeoff.
I totally agree that Java grew up with the 1.5 release. I didn't even consider it before. I just miss the delegate sugar.
Virtual and override are there for the same reason as C++ I guess. On non-virtual functions you don't go thru a function pointer in vtab.
OK, I see your point, and you are right. On that matters, operations have an higher cost on Java.
OK, it would be nice to have that, it can prove to be useful for better code readability.
First, I found the idea very good, combined with the "events".
However, there is finally lots of things to do (declare the event, the delegate, create the delegate, be sure the event contains one delegate at least before firing it or there is a null exception, ...) so it is sometimes a bit painful to use. But it is only my opinion.
Virtual and Override keyword: Fragile base class problem is why they are there. In Java you don't know when a class is overriding your method.
Generics: Come on Java Generics are not real Generics. Its objects with dressing. Yes Java Generics will be fixed in a future edition, but why did they release it in the first place.
C# is actually a pretty good language that keeps evolving... Java needs to evolve more...






Member since:
2006-05-10
Could you give some examples ?
To my mind, C# is too much complex as compared as Java. I would agree if you made a comparison with Java 1.4, but Java 1.5 brought what Java was lacking (like enumeration, generics, ...).
Things like operator overloading, structures, the virtual keyword, ... from the C# world are, for me, useless and bring confusion when reading someone else code.
With Java (>= 1.5), there is just what is needed.
Unless you speak of the .NET library ?