Its been at least 10 years since the last time I picked up Java for anything serious. 10 years ago it was my primary programming languaje doing Java Servlets, EJBs and the ocasional UI using Java Swing.

I am not going to lie, part of me hates Java because its an interpreted language and as much as the JVM has improved to runtimes that are comparable to C++, in my mind it is still a slow languaje.

In the next 10 years of my life I migrated to other languajes but found myself becoming mostly a Python guy, mostly because Python was the preferred languaje for SRE/DevOps at Sony Pictures Imageworks. Quickly I found that with Java it was super cool to write quick tools and forced programmers to make the code readable.

The main comparison and why I think Java is slow is about the programmers, and here are the 10 things I still don’t like about Java after 10 years.

The IDE’s suck

Eclipse was the hotness when I left Java 10 years ago, today it hasn’t changed much and its pretty slow and outdated. In my opinion XCode is an excellent IDE that boosts productivity.

Android Studio is not bad but it is overloaded with features that in some cases its hard to find, like the the file explorer (once you hide it, the option to make it appear again does not appear in the usual location where it appears in other apps).

You need to type a lot to get very little done

Yes I know there are workarounds but a lot of these very basic frameworks should come from the languaje itself.

For example converting an input stream to a string.

 1 InputStream is = Context.openFileInput(someFile);
 2 ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
 3 
 4 byte[] b = new byte[1024];
 5 
 6 int bytesRead = is.read(b);
 7 while (bytesRead != -1) {
 8   outputStream.write(b, 0, bytesRead);
 9   bytesRead = is.read(b);
10 }
11 
12 byte[] bytes = outputStream.toByteArray();
13 String myString = bytes.toString();

Code can get messy really easy

Bad practices affect a programming languaje but a side by side comparison of very simple code between Python and Java speaks volumes, for example the code on the previous point can be translated to:

1 s = ""
2 f = open(someFile)
3 for line in f.readlines():
4     s += line

Anonymous objects make things unreadable

Yes every programming languaje can be made unreadable but I think some may lend themselves to this purpose a lot easier.

Parsing JSON is a pain

JSON is such an important industry standard these days, why is the default official library not parsing things into native basic Objects? Also you need to know what object to expect so that you can use the appropriate method (getString, getArray, etc) For example:

1 JSONArray jsonArray = json.getJSONArray("Text");
2 
3 for (int i = 0; i < jsonArray.length(); i++) {
4     String imageName = jsonArray.getString(i);
5 }

The compiler could do more

Yes the compiler already does a lot and is very efficient but one of the beauties I have seen from the Objective-C LLVM compiler is that it translates from literals to basic objects resulting in shorter code. for example:

@"String" = NSString
 @{} = NSDictionary
 @[] = NSArray

It would be nice if Java had something similar.