Seven Reasons You Should Use Java Again

Java deserves another look. Here's why.

Java’s back, baby. Of course, lots of us never stopped using Java in the first place, or perhaps we weren’t allowed to. But where platform selection was elective, especially among startups and web developers, alternative platforms have offered more agility and expressiveness over the last 10 years. The likes of PHP and Ruby on Rails enable developers to do a whole lot more with less.

Times change, and 16 years on, this ain’t your father’s Java. Here’s seven reasons you should take another look at Java.

1. You can actually hire engineers

Not to be sniffed at when your Node.js Ninjas and Rails Rockstars get headhunted into the latest impossibly well-funded startup.

2. IDEs take the pain away

Eclipse and NetBeans are astonishingly powerful tools, and can mask some of the admitted horror that is Java API soup. Bend like a reed, admit you can’t know everything, and float downstream on the good ship autocomplete.

3. Language support

You don’t have to write Java to use Java. You can get all the benefits of the portable JVM runtime but scribble away in the familiar environs of Ruby or Python. It can be faster too. And that’s not to mention the newer languages aimed at modern programming such as Scala, Groovy or Clojure.

4. Android

Who can resist the little green robot? Google made a sensible choice when they chose the Java language to power what’s becoming the world’s dominant mobile phone platform. So, maybe Oracle has a billion-dollar beef with this, but programmers — new and seasoned alike — are picking up Java as mobile becomes the future of consumer software.

5. Everybody else does

Java’s ecosystem is a goldmine. Pretty much everything you want to do, there’s a library for it. Actually, there’s probably an Apache project for it. Very often the lowest impedance way to speak to the rest of the world is via a Java API.

6. It changes slowly

We’re celebrating the release of Java 7 right now. It’s been two years in the making, and frankly, there’s not a whole lot that’s changed for most people. If you can take your finger off the refresh button at Hacker News for more than an hour, any software that lives longer than a year becomes a real pain to maintain when the underlying platform keeps changing. Yes, looking at you, Rails.

7. You’ll end up using it anyway

At a certain point you’ll need performance, predictability and a ready supply of engineers. Scaling, deploying and programming to the cloud are places where Java excels. Twitter found this out, and will be talking about it at OSCON Java.

Related

Sign up for the O'Reilly Programming Newsletter to get weekly insight from industry insiders.
topic: Programming
  • http://www.rsurbano.com.br/ Fabiano

    Very Good.

  • Travis

    First let me say I am a Java Software Engineer for my day job right now..

    Reason 2:It is not the only language by which the IDE takes the pain away. Look at C# or VB.net.

    Reason number 6. This is true but they have been ramping up versions. With the hypothetical release of 8 next year their cycle is increasing. C# has had 4 major changes in 9 years. When performing the math between the 16 years of java and 9 years of C#. Java changes every 2.28 years while C# has changed every 2.25 years. So really not much difference.

    Reason 1,7: In regards to hiring engineers. From a report I had seen recently Java is the one language most sought after for Developers. Which means we are in high demand. Good for developers and competition but bad for employer’s as there are many places to choose from.

    Reason 7: Predictability and stability. This depends on platform and usage. C#’s file manipulation from what I have seen so far with JDK6 and before is far superior in C# 3.0 and beyond.

  • arkadiy

    Not very convincing.. I am not going back where I have to put hundreds of lines of code to do the same thing as a very few lines in Rails.

    Going through the reasons:
    1. Cannot find rails developer? Teach Java guys how to program in RoR! We gave Rails training to a team of Java developers. We had some resistance at the begging but now they are very happy they made the switch.
    2. RubyMine and Aptana are very Capable IDEs for Rails.
    3. Agreed. We actually use JRuby and deploy to JBoss. We still do some Java for messaging. JRuby plays very nicely with Java.
    4. There are some projects to make JRuby apps run on Android.. Not sure how mature they are though.
    5. We use JRuby so we can use any Java library available out there. The thing is we never had to. We are happy with stuff we can get in the Ruby world. (Well, with one exception of Tibco EMS. :)
    6. Slow changes – not sure if it is an advantage. I would call it Java cannot implement features fast enough to keep up with the changing world. That’s why programmers switching from Java to C#, PHP, Python and Ruby.
    7. We’ll see :)

  • http://www.i2e.es Emilio

    so do not forget to Google Web Toolkit (GWT).

  • http://www.33web.de Reste

    To me it is very important to understand the SOFTWARE. The entire operation must be understandable.

  • http://corbinsimpson.com/ Corbin Simpson

    If your API is Java-only, I won’t use it. Give me a *real* FFI, or don’t even bother talking about language-neutral accessibility.

  • Partdavid

    I’ve never understood the desire on the part of pointy-hair types to hire large numbers of mediocre programmers, nor anyone’s ambition to become a commodity programmer. It’s bad for both employers (who have to hire large teams to do the same job as with other languages–teams which become incrementally less productive as the bloat larger and larger due to mythical man-month problems) and employees (who are thick on the ground and vulnerable to involuntary turnover by outsourcing or other means).

    When your language demands you type pages after pages of scaffolding, rather than intent, the answer is a better language, not some kind of second program to do some of your typing for you.

    Given all that, what this post boils down to is that you use Java when you can’t make a better choice. You use it because you have to–your desired platform only offers it, the application you’re extending or API you’re using is Java only, your staffing geniuses have decided for reasons completely irrelevant to its merit to use it. It’s a *chore* you fulfill because you must.

  • Kaveh

    And there is one reason not to use it, Oracle.

  • Jason

    I’d like to second Kaveh’s thought. You can trust Oracle to be a good steward of Java about as far as you can throw Microsoft.

  • http://coder.cl/ Daniel Molina Wegener

    No, I will not work with Java agin for a few time. With Java I need to write 100 lines of code to do something that takes 20 lines of code in Python or another language…

  • Dave Smart

    Java sucks plus it takes half a dozen interviews to weed out garbage programmers from good ones… since everyone and their grandmother “knows” Java.

    Stay the hell away from Java if possible!!!!!

  • Martijn

    I think people emphasize too much the number of lines to write. In my experience, the duration of a professional development project depends not that much on the number of lines. What is important, is that you have quality code, something that is easier to achieve with statically typed languages like Java.

  • Dave Lopez

    No, we’ve moved on to C#/.NET and not looking back. Sun did a really poor job of managing Java.

  • http://twitter.com/grechaw Charles Greer

    I’d like to hear deeper thoughts on this. The discussion brings up questions about code management, the role of engineering in a business, language design, and vendors. The one thing missing from the post and the comments is that, in a business, computing resources are allocated to meet strategic business goals, which may or may not be aligned with a platform choice for enterprise computing.

    I’m actually a big JVM fan and appreciate your points about redeeming Java. It’s come a long way, and provides an exquisite if Byzantine engineering toolbox for business solutions.

  • http://simon-fenn.blogspot.com/ Simon

    I’m a Java fan but in reason #2 “admit you can’t know everything [about the API]” is probably the best advice I have ever read about Java.

  • Tee

    I think the main reason why Java programmers have a reputation of being less skilled than, say, Ruby programmers, has nothing to do with Java itself. The majority of programmers in the world don’t work for technology companies; they work in corporate IT departments. Unfortunately, programmer skill and creativity in corporate IT departments are much lower priorities than they are in a software company. After all, an IT department is a cost center to be minimized. In contrast, software developers in a software firm create the company’s revenue-generating products, so they need to be very good at what they do. Java is very popular in corporate IT departments, mostly because companies like Oracle and IBM have standardized on it in their middleware products. Once Ruby and Python penetrate the corporate world, I think you’ll start to see a large crop of mediocre programmers in those languages too. I know I just offended a lot of programmers who work in corporate IT, so……. sorry!! But hey, if you work in a corporate IT department, and you are a very skilled programmer (and you really love programming) then why the heck are you still where you are?? Go join a real software business!

  • Dave

    @martijn: “What is important, is that you have quality code, something that is easier to achieve with statically typed languages like Java.

    Lol. Status languages “solve” one particular type of bad code, the kind of bad code most developers don’t write. Talk about a false sense of security: “I don’t have any red squiggles, I have quality code! Yay”

  • http://android-pro.blogspot.com Mina Samy

    I believe Java will survive because of Android and the enterprise applications, other than these two reasons Java now cannot compete with PHP in web development, Java has to do more in web development

  • http://backspaces.net/ Owen Densmore

    Javascript: It is the most available language on the planet: in every browser, on every phone, has interfaces to video, 3D, audio, DB etc (w/ html5) and now on every server (node.js) and the networking data format standard (JSON).

    Javascript Every is the next big thing. It’s lisp w/o parens, Python with braces. And you know it, so I’m a bit surprised you are so happy with Java.

    Java will likely be best known as the first JVM language and folks will wonder why its not RVM for Rhino VM.

    Oh, and Oracle? Sigh.

  • Dave G.

    @Mina Samy: Take a look at Play! Framework, I think Java is getting its momentum once again, the web framework itself is refreshing and takes less time to configure than Zend Framework/CakePHP.

    Taking in account all the quality libraries available in Java I think it will compete head-on with PHP in the future (ditto, only in web development)

  • J.T. Wenting

    Most important reason: all the idiots who only care about the latest hype have mostly disappeared, following those hypes, and ended up in dead-end Ruby and Scala jobs, leaving quality people who actually know what they’re doing behind. The kid who writes he uses php because it’s free is a case in point :)
    Been using Java non-stop since 1997, and it’s not yet got worse (though I severely distrust the me2! nature of a lot of the things added in 1.6 and now 1.7, I don’t like the trend within the JCP of everyone trying to get his or her name on a JSR just by shouting that “if we don’t include this and make Java more like Ruby/C#/php/Scala/whatever Java is dead” and getting their pet features approved.
    Which is why most serious professional couldn’t care less about 1.6 or 1.7, they’re using 1.5 (or earlier) language features and running on a later JVM for availability and/or performance reasons only.

  • allcorrect

    Tee,
    “But hey, if you work in a corporate IT department, and you are a very skilled programmer (and you really love programming) then why the heck are you still where you are?? Go join a real software business!”

    You’re dead on. I work for a major financial services firm in NYC, and I have only recently begun to see the light. Call me immature or naive or maybe lucky to see some good work, but I spent the first ten years of my career not realizing this important distinction. It may also be the back to back jobs in non-IT corporations that I finally began to see the light.
    Anyways, my redemption is to leave the non – IT corporate world forever, and sooner or later start my own IT company :) And in the meantime, get into either research or a pure software development company. No more corporate backrooms. Soon!

  • Michele Costabile

    Not really. Java is a great language regarding syntax and the general environment, but:

    !) it is second choice for desktop applications for the usual sandbox/emulated toolkit/inferior experience stuff
    2) it has created one monster after an other in the web realm, from the low profile JSP, to the unbeliavably complicated J2EE, to the weird JSF. Every time it is one thousand pages for the web toolkit, one thousand pages for the spring or hibernate that will prevent you from selecting stuff from the database as usual.
    The size, count and complexity of everything will be perceived as quality only in multi million dollar projects. For anything else it is too complicated.

    Considering price, performance, toolkits, mantainability, I would go Python these days.

  • http://www.mfrbee.com/trade/ Super

    ” It changes slowly”, Wow, is this a reason to choose java ?

  • Yannick Majoros

    Most negative comments here look like uninformed ranting to me. I don’t know why you are typing 100 lines of java code for 20 in your favorite hyped language. Most of those comments really look like coming from people who don’t know what they are criticizing, assuming that everyone agree anyway.

    I use Java EE everyday. Yes, EJB, JSF 2 etc.

  • dotnetGuy

    why the need of this article in the first place? a lot of people leaving the Java ship?

  • DunTrusOracl

    Sound like an article funded by Oracle. I can give you “Seven reasons you should use COBOL again” too.
    Java is not dead yet, but if I start a new project I would use Scala instead of Java.

  • Max

    Java IS Running on 3,000,000,000 (Billion) devices and growing.

    Have a nice day…

    • Dr4k

      C is running on every single device so you have a nice day sir

  • qwerty

    If a language needs an API to be productive in the language is crap.

    Java the language IS crap.

    Java the platform is not crap. Luckily there are better languages then Java on the JVM. With Java 7 adding in support for dynamic languages,that is as a good as an admission that Java the language is subpar.

    Other then Groovy(which also sucks) and Jython(lagging behind Python too much there are enough great languages that makes the Java platform viable – Clojure, Scala, JRuby, and Rhino.

  • qwerty

    Meant to say IDE not API

  • Mike

    Java exists because mediocre programmers exist.

  • Mike

    “I think people emphasize too much the number of lines to write. In my experience, the duration of a professional development project depends not that much on the number of lines. What is important, is that you have quality code, something that is easier to achieve with statically typed languages like Java.”

    More lines means more bugs, harder to understand and it takes much longer to write.

    Other languages can produce the same application, with the same quality with a 1:10 ratio and sometimes even a larger ratio, that is significant.

    A 500,000 line Java app can likely be done in 30k-50k lines in Python, Lisp, or Ruby. That is extremely significant as programmer time is the most expensive part of development.

    Static typing, especially Java’s typing system does not help you much. Java is NOT typesafe and it is more then easy to get various type related exceptions during runtime.

    Java static system is also one reason why it takes so many lines of code to get anything done. There is a reason all of the Java web frameworks go though exceptional effort to get around the type system.

    Look how many sort functions exist in the Java SE API, and how many there are in, say Ruby(exactly one) and the Ruby sort method is far more flexible then all of the Java sort methods combined. AKA, sort() in enumerable module can be altered at runtime to sort a list of objects of Class A in nearly infinite ways. And that is without bloating up the standard libraries or your Class A file.

    Mediocre programmers rely on the compiler to help them debug code. Java was created for the mediocre programmer.

  • GregJF

    I’ve got to agree with Mike.
    If a language REQUIRES you to code more pumping to get tasks done than other languages, then that languages is tired and needs an overhaul.

    If Oracle wish to make Java prominent again then the need to do a complete overhaul of the Java language and the frameworks.
    For instance, they could implement:
    – Partial Classes
    – Extensions to classes
    – Lambda functionality
    – Classes that do LOTS of the pumping
    – Attributes for classes that can be used for aspect programming

    They could also:
    – cull some old frameworks eg Java Severlets
    – Enhance JSP to use:
    – MVC
    – XML
    – build a better ORM framework
    – embrace Domain Model patterns in design

    And that is just to bring them close to Microsoft’s .NET and some of the language optimizations that langauges like RoR has

  • LOL

    “Been using Java non-stop since 1997, and it’s not yet got worse (though I severely distrust the me2! nature of a lot of the things added in 1.6 and now 1.7, I don’t like the trend within the JCP of everyone trying to get his or her name on a JSR just by shouting that “if we don’t include this and make Java more like Ruby/C#/php/Scala/whatever Java is dead” and getting their pet features approved.”

    So basically you are saying you are scared of “new” things, even though the features you are frightened of are much older then Java.

    You are the prototypical Java API monkey. What you are not is a programmer.

    You are one of the reasons why Java has such a bad rep. It was developed mediocre and crappy programmers.

  • I cannot believe this

    1º and most important u would only use java to save time making ur program.
    2º Java is slow because there is a virtual machine that interpretates the code at running time. This is a big problem if ur making a heavy program or simply need the data processed fast.

    So only use java if you know the aplication doesnt require massive calculations (will save u time)

    The garbage collecting feature is nice (noob friendly) but for a PERFECT SOFTWARE (by perfect i mean that it runs the fastest way possible and dont waste resources)
    u wouldnt want this instead it would be better the hardcore way (like the infamous malloc)

    So when to use java?

    Use it if ur aplication is rather simple and u want it to run in every platform.

  • Californacation

    i can’t read the post, only the comments.

    What happended to this site?

    • tquartarolo

      Thanks for reporting this unusual rendering problem. I was able to get this all fixed up.

  • http://www.webhostingmalaysia.org prince

    Most developers in malaysia are using PHP. i can say more than 60% of them because it’s free. Can you explain the security comparison between php and java?

  • http://twitter.com/#!/@ChrisAllenNow Chris Allen

    I took up Java again, for exactly reasons 1 and 2 and 4. Especially 4.

    But contrast these with the reasons we all took up java the first time: it could not touch the hardware, and it only played in the sandbox.

    One other reason still persists: it is architected to prevent bugs or viruses creeping over application boundaries.