Keith Watanabe * NET 2.0

Java Is NOT An Agile Language
By: Keith Watanabe
Published On: 8-7-2007

My big boss asked me why my side of the project has been taking so long.  Why would a business layer be so hard to code up?  Why is the testing ridiculously slow?

My answer: Java doesn't help this.

Perhaps, it's my level of expertise in the language, but after dealing with this project, I've come to realize just how HEAVY Java can be.  I haven't had a chance to work in detail with the latest version, so I can't say that some of the newer features have made it better (I'm sure it has, but there are still deficiencies in the language).  It could be my lack of experience with Eclipse.  Maybe I'm not utilizing the right plugins and doing far too much "hand coding" in terms of boilerplate code.

No, the problem is that the language is too bulky and takes itself too seriously.

Read that statement again.  Especially the last part.

Let me provide an example.

Let's say you have a primitive type that's supposedly a char and is saved into the database as a number (0 or 1).  so in reality you need an int.  But let's say another object requires it either as an int or be turned back into a string.  So if you try to parse it, you might get an exception rather than letting the language auto-convert it.  So you're doing many things here: 1) checking if the value is null; 2) checking if the type can be converted; 3) potentially converting it over to another type; 4) converting it again.  And you may have to wrap all these operations in a big try/catch block.  If you're working with a database that may contain null values, and you're forced to use primitive types, you're royally screwed.  I mean, all you're trying to do is guarantee a value type, but you still need hundreds of checks.

This is just awful.  And it's just for one value.

What if you have 40-50 values?  How much of this do you have to deal with?  What if you have to deal with several operations that require you to do this 40-50 times?  What if there's no easy way to loop through the parameters in your object without having to take out the equally bulky Reflection API?

In perl, since objects are glorified (or blessed more specifically) forms of hashes, arrays, scalars or globs, you could, especially if you use a hash, provide a method that can loop through, utilize the Fields pragma, and easily get the same benefit.

In PHP, you can utilize variable interpolation by doing something like this for a dynamic method call:

$obj->$method()

You're pretty much out of luck with Java (at least in doing some easily the same way).  You can't naturally take advantage of in-built features to really help you through these situations.

Worse yet, you might be forced to code declaratively in XML because it's nearly impossible to do something easily and dynamically in Java.  Take Spring and Hibernate as examples of this.

Out-of-the-box, Java is just a monster of a language.  You are forced to employ various plugins, IDEs, frameworks, etc. to really get any significant and immediate benefit.  And that can take a while to do as well. 

Notice the words used there: "a while."  That implies time and implies not moving fast, which in turn implies lack of agility. 

More of my friends are turning towards languages  like Ruby and being empowered from getting more work done through frameworks like Ruby on Rails.  I think people who continue to use Java are quite arrogant in believing too much in Sun's marketing.  Java only is good in the hands of those that use it.  But for me it's too difficult to get any real benefit that I can see.

The truth is, at the end of the day, you just want to be productive.  The language is truly irrelevant as long as you and your peers utilizing it understand in detail how to get the best out of it.  I for one see Java as being verbose, cumbersome, and unnecessarily detailed.  The flaws that kept a lot of C/C++ programmers away I think never were truly addressed.  C/C++ programmers have some advantage over Java people since they have more power and speed naturally. 

Overall, if you need to execute something quickly, consider NOT using Java to do the job, unless your people are extremely adept at it.  Mine aren't, nor am I so I think I will continue to stay away from it where possible.

AddThis Social Bookmark Button Sphere: Related Content

Trackbacks: (Trackback URL)

No Comments Posted Yet

June [July] August
Sun Mon Tue Wed Thu Fri Sat
29 30 1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31 1 2