For many years I enjoyed working on the Windows platform writing applications in C++, Win32, MFC and ATL/WTL. I was not an early Java adopter. I had taken a Java course but continued to work in C++. More and more of my friends had made the switch to Java and told me how much they liked it.
In 2002 I started programming in Java. In 2005 I took a course on C# and .NET as well as doing my own learning. I only got a little hands on experience with it because I was doing to much management.
There are many things about C# that I like more than Java:
- The verbatim strings: @”string that can span lines”
- Unsigned integers
- Structs for defining your own value types
- How types are unified so that value types can be used as objects (Boxing and Unboxing). Yes, Java has this now but the C# way seems more unified.
- The namespace concept is a little better than packages.
- Properties
- Delegates and events
I can take or leave the C# preprocessor. I’m not too fond of attributes or annotations. They have their uses (and abuses) I just haven’t had a strong need for them. I didn’t work with the .NET library enough to say if I like it better than Java. I don’t like ASP.NET because it doesn’t seem as flexible as the Java layering of Servlets and JSP. I could be wrong about that.
The reason I like Java better, and it out weights all of C#’s advantages, is the perceived attitude of the Java community. When I look around at what is going on in the Java community I see many people working on all kinds of interesting things. There is an attitude of “Hey that would be cool, I’ll build it”. When I look around at the .NET community I get the sense that people are waiting around for Microsoft to provide all the infrastructure.
I know this is a gross generalization. I’m sure there are people doing interesting things with .NET and more importantly people who are happy to be working with .NET. This is just how I perceive things. As a data point there are about 5,000 C# projects on SourceForge and 23,000 Java projects. This could be because Java has been around longer or perhaps SourceForge is not the place to look for .NET projects.