Friday, June 17, 2011

Java's Advantages over C#

Recently I've had an argument with myself about which language to use for combined desktop & web application. After a few sleepless night, I've come to the decision: Java. The main advatages that I've seen in Java compared to C#.NET are the following:



1. The amount of reference resources (i.e. solution to problems one may find on the web) is several times the amount of reference for C#. The reason for this feature is that Java is based on open-source & community mutual help, whereas C# is based on the proprietary .NET framework, which means that Microsoft is supposed to supply the main portion of reference and developers are less likely to participate in help forums.

2. Java is the main flatform for cell-phone applications, whereas C# seems quite irrelevant for this field. As an independant developer, it might be irresponsible to neglect the cell phone field, by abandoning every possiblilty of creating such applications.

3. Java is free whereas C#.NET costs $500-$1000. It may be insignificant to firms, but for individual developers it's not always so. Furthermore, I believe that psychologically it's easier choosing a language platform which one is sure is going to be free for the years to come and for the versions to come.

4. C# seems to be very web-oriented, which means that it's mostly used for web applications. Java seems to be used for a larger spectrum of applications. This may be imporatant for a developer who can't see his/her future mainly in the web development field.

5. Java is a cross-flatform language, which means that every application developed in Java should be comapatible with every operation-system in the market (Linux, Apple OS etc.). C# is basically limited to Windows computers, so by using it, a developer loses much of the distribution potential of the developed product.

To summarize - as an independant developer, I just can't afford a language rellevant only to Windows, taking into consideration the increasing market of cell-phone applications and the Linux arena.

2 comments:

  1. I agree there's more reference stuff for Java out there. On the other hand, I rarely need any of that stuff for C# because the Framework is such a comprehensive SDK that I rarely if ever need anything outside of it. Actually, I find this a big advantage of C# as long as you can stick to Windows. I only have to learn about one SDK rather than use one graphics package for this project and an entirely different one for the next with different build technologies, etc., etc.. This is largely because of the type of stuff I do (mostly windows exclusive and not dealing with a zillion incompatible standards - mostly straight algorithmic work). I'm not sure where the "C# is $500-1000" came from. Visual Studio Express is free as is Mono. Both let you do as much C# programming as you'd like for free. I'm also not sure why you think C# is "web oriented". I've worked with it from day one and have done essentially no web programming. Really, it sounds like you've not investigated too much and just saw ".NET" and concluded "it must be for the web". I think calling it ".NET" was a horrible marketing choice on MS's part since it isn't web oriented in any way. Well, perhaps it was shrewd marketing ploy, but it's not descriptive at all. As with Java, there are libraries for dealing with web programming but the vast majority of the Framework has nothing to do with it. If you're under the impression that you can run "every application" in Java on "every platform", then you're living in a pipe dream. Almost every java app I've seen requires all sorts of third party or open source packages. Some of them are cross platform, many aren't. All of them have to be downloaded, studied and learned about each time you want to include one of the many references you talked about. In contrast, I can download almost any C# project and run it immediately without having to load/learn a plethora of miscellaneous packages. Again, I consider that a very good thing. Also, I don't think C# is "entirely irrelevant" for mobile development. There's an entire version of CLR devoted to it - .NET Mobile. Not as relevant as Java, but hardly irrelevant.
    Finally, you don't actually compare the languages themselves. I'm just starting into Java after a long time of working in C# and there's not much advantage I can see in the language itself. Generics in Java are just syntactic sugar for a lot of casting and so afford no real performance advantages and impose all sorts of constraints. It's just a really crappy implementation of a key feature in any modern language. C# has integrated generics tightly into the language and has real advantages for generics that can't be achieved in Java. I'm dumbfounded that there are no unsigned types in Java. The lack of properties is really ugly. I hate that every java class is littered with get/set routines when it is all so nice using properties in C#. The lack of overloaded operators makes for lots of ugly syntax - especially when dealing with numeric types such as complex or BigInteger. I could go on, but there are lots of nuts and bolts language issues that C# has the upper hand over Java on.
    All that being said, I'm not a language wars religious zealot. If you want to work in Java, have at it and I hope you really enjoy your work. As you point out, you'll be in good company and there's lots and lots of people out there who have made the same choice. Whatever you do, enjoy!

    ReplyDelete
  2. "The amount of reference resources (i.e. solution to problems one may find on the web) is several times the amount of reference for C#."

    Any data to back this up?

    "The reason for this feature is that Java is based on open-source & community mutual help, whereas C# is based on the proprietary .NET framework, which means that Microsoft is supposed to supply the main portion of reference and developers are less likely to participate in help forums."

    Are they? On StackOverflow right now there's 58,423 questions tagged Java and 73,468 questions tagged C#.

    ReplyDelete