Κυριακή 13 Σεπτεμβρίου 2009

Why Java - Part 1

This is my first blog entry and I decided to share my thoughts on a vague question: why I use Java and why I recommend it to everyone.

First of all let's see what are the alternatives. Well that depends on what you want to do. If you want a general purpose language that can cover the needs of an average software company which is a mixture of web and desktop applications then you really have two alternatives: Java and .NET and probably Delphi. Unfortuantely I will take Delphi out of the equation because it is kind of obsolete. There are also the increasingly popular dynamic languages like Ruby, Perl, Python and PHP to name a few. But these languages are mostly used for web site applications.

I won't go into a comparison of specific features, because to me Java and .NET are roughly equivalent in technical features. However, I will address some other not so technical issues. I will start from the most important: freedom.

Freedom is the power to choose, the existence of alternatives. Some people think this is not good and they can argue on that. Some others, like me, think it is really good and, believe me, I can argue on this.

Java is all about freedom, alternatives, open source. In Java you have to choose almost everything: the IDE (Integrated Development Environment), the application server, the operating system, the web framework, the persistence framework, and now even the language itself, and many other things. For every item in the previous list there are many, many options to choose and most of them are open source!

On the other hand, .NET is very restrictive in choices. Officially it runs only on Microsoft windows operating system, it has only one IDE (Visual Studio which is very good), only one application server (Windows Server), only one web framework, only one persistence framework, but supports many languages! I admit that there are some alternatives (like Spring .NET and Hibernate .NET which are ports from Java) but they are used by very few people and to many are not even considered an option. The good thing is that all of the above are very good and will help you write awsome piece of software.

So if .NET is such a complete solution without alternatives (or to be exact few of not so good quality), what's so wrong about it? Actually most .NET programmers find nothing wrong with it, probably because they don't have and have not used any alternatives. They all bring up the same argument: If you have two many choices how do you choose which one is better? In contrast, if you only have one choice and everyone believes it is very good, then you follow this choice and you are sure that you won't regret in the future. What is more is that you learn something today that you can use it everywhere you work. You can invest reading on .NET without being afread that you might read something else in the future.

Java unfortunately has many alternatives, and if you choose one you may have to learn another one or more in the future. So the bottom line is that Java requires a lot of reading which is not so good if your goal is to make money from writing software.

The good thing with alternatives and especially open source alternatives is that by studying different solutions of the same problem you become a better and more mature programmer. You also save a lot of money because most of the alternatives in Java are open source. Ask a .NET programmer if they have licences for all the .NET features they use for every developer. Ask them when they deploy the application to multiple servers if they buy proper licences? In Java you can deploy an application to thousand of servers and not pay a penny. You can set up a development environment for a large team of developers and not pay a penny also.

A professional Java programmer should have evaluated and used more than one alternative because on different projects some alternatives apply better. A .NET programmer does not have any alternatives and relies on Microsoft to provide him with better solutions to his problem.

Most Java open source alternatives are of highest quality and outer perform .NET in some issues. Take Spring framework for example. Spring is one of the most amazing frameworks ever conceived. It was not conceived by Sun architects but by Rod Johnson and this shows that although Sun, an advanced high tech company, invented such a powerfull language as Java they did not bother to create a simple and powerfull framework like Spring (Sun J2EE is highly complex). In .NET there is no alternative application framework from Microsoft. However thanks to Spring team a port was made to .NET delivering Spring features to the .NET community. But how many people use Spring.NET? Very few because most of them they learned to rely on Microsoft for the framework. This is a closed minded approach.

Consider another thing, many people on Java community might thought that after Oracle bought out Sun, Java's openess is questionable. But this is not true simply because Java is such an established technology that Oracle would not dare to destroy this golden egg trying to make money by putting an end to Java openess. Java wide acceptance is based on two things: it's very good design and performance, and a vast open source community constantly expanding Java.

On the other hand, if something similar happened to Microsoft (!!!) what would happen to .NET. Well .NET is already closed so there would be no problem at all. So people using .NET tend to feel more secure in terms of vendor support whereas Sun did not go well because it made litle money out of Java due to its openess. Regarding this, the future will show the truth but I am confident that Java will never die because of Sun. There are so many communities willing to take over Java from Sun.

To put an end to this article, the moral about Java vs .NET is: open or closed minded? Which one do you choose? Fortunately things in .NET begin to change but still .NET is years behing when compared to Java in terms of openess. However, the existence of .NET is a very good thing. You should know why: it gives another alternative to choose from, it makes you more mature by studying different solutions to the same problem (some of them are better conceived in .NET).

2 σχόλια:

  1. After reading this I would have to say you know little to nothing about .NET.

    1) There are MANY ORMs in .NET (There are even many from Microsoft L2S, EF, etc). Once we enter 3rd parties such as nhibernate, lblgen, and others there is quite a bit of choice. To say that "noone uses them" is insane.

    2) There are many web frameworks. Even Microsoft has multiple (WebForms and MVC) but then we can go grab FubuMVC or Castle amongst many.

    3) The technical aspects of Java and .NET are not equivalent. .NET went past Java a while ago and continues to push ahead ... working generics generics? Linq? theorem proving dbc in .NET 4?

    There are many reasons one may want to choose java over .NET but it seems to me this article is for the most part non-informed.

    ΑπάντησηΔιαγραφή
  2. I never claimed that I am a .NET developer. I have used Microsoft products in the past and I also talk with other .NET developers.
    I am try to be as much unbiased as possible.
    I never said that there no other frameworks in .NET. I only said that are not mature and feature rich like the one' in Java. And yes there are people in .NET that use them but they are minority.

    The ORM's you mention are commercial and closed source. .NET frameworks are mostly commercial and closed source. In contrast, 80% of Java frameworks are open-source (and maybe more).

    I imagine that you are well informed in both Java and .NET to make such comments!

    ΑπάντησηΔιαγραφή