Some Java folks are looking down on C#? I don't believe it :))<p>In my experience it's always been the opposite: C# guys have always looked down on Java folks. And rightfully so: the language itself is nicer, the standard library is much nicer, and the CLR+CIL are vastly superior to JVM, especially in memory management department.
After reading about "Explicit virtual methods" I lost all my interest in C# forever.<p>I don't want this, seriously do not want. I don't want a language "with lovely features from C++". Explicit virtual, structs - please take those and leave me alone.<p>Lambdas are nice, some syntax sugar is nice, but not that creep.<p>Please don't take this as flamebait. I know a handful languages, I do backend development and I just absolutely don't need some language features and I fear that somebody would use them in their little library and would POISON the lifes of anybody who touches it.<p>Java has some "do not want" features too, like checked exceptions, but those are more or less solved these days.
Considering that for the last several years nearly every significant improvement to Java has come from them copying from C#, if anyone should be looking down it is the C# folks.
It'd be tough to argue that Java is better than C# (the programming language). The benefits of Java come not from the programming language, but from the ecosystem, the JVM, the libraries, and the platform.
Credit has to go to Anders Hejlsberg, who keeps innovating upon C#. Microsoft in this case has played to their strengths because<p>1) it does not have to worry about language standardization and the various community processes that accompany Java.<p>2) Anders is exceptionally good at deciding what language features are go/no go.
The author makes some fair points. Java generics are a bit clunky. C#'s more liberal application of autoboxing can be nice. Some other options for string literals would be helpful, especially for writing regular expressoins without a ton of backslashes.<p>Checked exceptions are not something that I'd happily give up. We do have unchecked exceptions (RuntimeException), and the JRE generally uses them where appropriate. But what about methods like Inflater.inflate, ImageIO.read, or Class.getMethod? If these didn't throw checked exceptions, we would sometimes forget to catch exceptions which should almost always should be caught. It would be a step in the direction of a weaker type system, unhelpful errors, and less graceful recovery.<p>Regarding initializers, we can do the same thing in Java by giving an initializer block to an anonymous class:<p><pre><code> List<Integer> L = new ArrayList<Integer>() {{
for (int i = 0; i < 10; ++i)
add(i);
}};</code></pre>
Too bad he didn't get into any of the stuff that really makes C# nicer than Java, in my opinion: lambda expressions and closures, LINQ, expression trees, dynamic typing, type inference, P/Invoke vs JNI.<p>Also the event / delegate thing makes C# really nice for GUI stuff.
Delegates + Events are another innovation in C#, is a much cleaner approach than Java anonymous classes + interfaces IMHO. I think anonymous classes are good in both compilers but Java is really missing a delegate/event standard system.
Suprised that reflection wasn't really mentioned outside of the concept of generics. Reflection in .NET (and C#) is extremely powerful and useful.<p>All those other things that people have already commented on like Lambdas, expression trees, events and delegates, are incredibly nice to have.<p>Here's the first thing I write when I start a Java project, followed directly by an abstract class based on it:<p>public interface ICallback<T>
{
public void Invoke(T state);
}
I always enjoy these Java vs. C# threads. They are like dispatches from a world where there are only two, absolutely terrible, languages. It makes me happy that I live in a world where I can choose between dozens of languages, some of them actually decent.