You are here

Java must be stopped

Java has passed its expiry date. It is no longer the only cross platform, fast language available. There are few examples of widely used Java applications. The few popular ones there are are noticeably slower and more resource intensive than native apps. And as a developer, I waste far too much time worrying about types in Java and generally writing out a lot of boiler plate code. Here are some examples of Java compared to Python (a more modern language):

converting an integer to a string in Java:

String aString = Integer.toString(aInt);

converting an integer to a string in python:

aString = str(aInt)

consider using a dictionary, or hash map in Java:

Map<String, Object> env = new HashMap<String, Object>();

in python:

env = {}

Notice how much cleaner the python implementation is?

I don’t even need to care about types, actually, I don’t even need to worry about using semi colons. Python enforces nice looking code by forcing the developer to indent properly. How cool is that?

As a C++ programmer, getting past the concept of a dynamic typing language as easy to work with as Python was tough. But the reward so sweet. Using duck typing, I can make a function that takes in any sort of argument and all I need to ensure is that the argument has a certain interface.

It seems to me that since punch cards computer languages have been evolving to be more easily read and less verbose. With each new generation of languages allowing developers to write one line of code that would be the equivalent of 10 lines of code had he used an older language.

There are two main reasons why Java and C/C++ are still the defacto standard languages: there is an existing large Java and C/C++ code base to maintain, and to replace it all would be a very expensive undertaking. And also, there are many Java and C/C++ programmers. Many of whom aren’t even aware that there are easier ways to write software.

There is an argument for learning Java: it’s more likely you will find work with Java. But if you are interested in just writing solid software quickly, you should consider using a language that is more congruent with “quickly” and “easy” than Java.

There are Java developers who will say “but java is faster”. There are many examples of python performing just as fast if not faster than java or C/C++. The problem with saying “Java / C / C++ is faster” is that you assume programmers know how to truly use Java or C/C++ to be fast. It seems that many developers think that just because they use a particular language, it will automatically be fast. The truth is is that modern compilers and interpreters are pretty blindingly fast, it’s only when you go off the beaten path to customize routines that you usually find your speed gains. Java is a notoriously slow, massive beast, things slow because developers use many libraries and frameworks. These need to be loaded and initialized, which takes time. This is due to the tools a developer chose to use, not which language he/she used.

Funny how only a few years ago the argument was “C/C++ is faster than Java because it is compiled and Java is interpreted”. There are many examples of Java performing just as fast as C/C++ or even faster. These days it seems people have accepted that Java performs just as fast as C++ for many tasks, but if you have performance intensive routines that need doing, you are more likely to get speed gains by using some custom C/C++ code.

The truth is that most developers don’t care that much about speed cause most apps they make don’t need to be especially fast. I would say that most Java dev’s I know like using libs and frameworks. Libs and frameworks both make your life as a programmer easier but comes at the cost of more app bloat.

If you want your development to be easier, use an easy-to-use language and stop trying to put lipstick on a pig.

[a Cobworks commentary – the original appears there with more detailed code examples]

Related posts

5 thoughts on “Java must be stopped

  1. 719057 684778I dugg some of you post as I thought they were handy extremely helpful 39483

  2. 422385 45026Glad to be one of several visitants on this awesome web site : D. 202640

  3. 175655 922288hello, i came in to learn about this subject, thanks alot. will put this internet site into my bookmarks. 817852

  4. Why users still make use of to read news papers when in this technological world everything is available on web?

  5. Wonderful beat ! I would like to apprentice while you amend your web
    site, how could i subscribe for a blog web site? The account aided me a acceptable deal.

    I had been a little bit acquainted of this your broadcast provided bright clear concept

    Check out my web blog :: http://nutrakineticketoadvanced.com/

Comments are closed.