Sunday, April 19, 2009

Does Anyone Love Java? Nah.

A post claims some people love Java. Fair enough: I'm sure some people love Java.

How many thought leaders love Java? How many people whose opinions we care about love Java? I'd wager it's a small number. Many of the most prominent in the Java world spend their time working around Java's limitations via frameworks, environments, and tools.

Do they "love Java", or do they react to its weaknesses because that's the environment they're working in and they want to make it suck as little as possible? They're spending their energy making the Java ecosystem a better place in which to live.

The article continues: "Why love Java? Let’s look at what Java offers: portability, automatic garbage collection, object orientation." But these features aren't unique to Java: why love Java in particular? What's compelling about Java the language?

Why love Java? Because there are great tools and libraries? That's a reason to love the Java ecosystem. What about Java the language? What does Java bring to the table that makes it worth loving? Okay, static typing makes tool development easy. It's also one of Java's greatest hinderances, and makes for redundant, boiler-plate programming. So it's a reason to like Java in one regard, but detest it in another. For me, reducing cognitive overhead is more important, so I lean to the "detest" side.

Using a google search for '"I hate Java" programming'? At the very least search for "Java sucks" (~14000), "Smalltalk sucks" (345), "Ruby sucks" (2390), or "Lisp sucks" (3120). '"I love Java" programming'? I got results for t-shirts. Doesn't count.

Show me why people say they "love Java". Here's one answer (I found surprisingly few, despite the "high" number of hits: 4910): "I love that Javadocs exist! I love that Java makes it easy for sane people to write decent software, relatively easily. I love that I have tons of pro tools that make development a breeze (IntelliJ IDEA and JFormDesigner amongst many others). I love Ant. And I love that compiler."

Javadocs? Allows sane people to write decent software relatively easily?! Ant? The compiler? These aren't reasons: there are documentation tools for essentially every language. The second point doesn't deserve a response. Ant may be a step up from make--but steps away from better tools. "Love that compiler" isn't even a reason... and they didn't even mention the JVM (also not Java, but the JVM is pretty bad-ass.

Here's another: "I love Java for how advanced it is, for the standards (see JCP and JSRs) that have been defined, for the other languages that you can run on top of it, for its rich frameworks and libraries, ..."

Advanced compared to what?! The standards... oy. The languages you run on top of it? That's the JVM, not Java. There are a lot of frameworks and libraries for Java--but they're all saddled by the same things that make Java broken, or exist to help alleviate Java's deficiencies.

Another: "I'm a big fan of programming in Java because it's so easy and fun." Compared to what? Obviously you're not familiar with the slew of easier languages, most of which are more fun, precisely because they're easier, more natural, and so on.

So sure. Some people may "love" Java. But until we see some concrete reasons why they love Java-the-language, and until they account for what they're comparing it to, I'll look at such claims somewhat skeptically. So far the only people I've run in to that "love Java" are people that (a) know very few other languages (and what they know are things like VB and C, not Lisp, Smalltalk, Ruby, Python, and so on) and/or (b) aren't very good programmers.

I know good Java programmers, but they don't "love Java": they tolerate it. The programmers that I happen to respect and listen to don't "love" Java--most dismiss it out of hand, and can provide reasons for doing so.


ted said...

So what is so important about 'loving' a computer language? I would never asked myself that question. Really - who cares? I know what I do love - creating great solutions for my customers. Java lets me do that just as well as I could in any other language. And I consider myself a very proficient Python developer as well. Don't really care about loving that language either. The real world doesn't care what language we use.

Dave Newton said...

Java lets me do that just as well as I could in any other language. That may be true for *you*, but it certainly isn't true for me, and I'm adept at Java and its ecosystem. Java works against my craftsmanship. Java makes me say the same thing too many times.

Why does "loving" a language matter? Because I'd rather work with tools I enjoy wielding. The "real world" may not care what language I use--but *I* do.

Anonymous said...

That may be true for *you*, but it certainly isn't true for me, and I'm adept at Java and its ecosystem. Java works against my craftsmanship. Java makes me say the same thing too many times.That means you are doing it wrong. Good code is easy to write in any language. If you are talking about verbosity of types, learn to use your IDE.

After spending a lot of time in ruby, prolog and lisp, java is a breath of fresh air. I can deploy desktop apps. I dont have to worry about performance. I can use GWT. I can use industry tested tools and not have to work around obscure bugs because no one has ever used it in production.

You seem to be confusing java the language with java + toolset. I wager I can beat anyone in speed of construction with java. I certainly gained a huge amount moving from lisp/prolog primarily because of the tools.

Dave Newton said...

No, the post this is in *response* to confused Java-the-language with Java-the-ecosystem. I'm pretty happy with Java-the-ecosystem and have spent the majority of my time over the last decade living in it. Java-the-language, however, is far, *far* from *my* ideal language.

If you're going to try and convince me that I'm "doing Java wrong" because I have to repeat myself you're barking up the wrong tree.

Good code is not *as* easy to write regardless of the language, and to believe so is to completely reject decades of computer science, language research, and reality.

Dave Newton said...

(And if you're that much more productive in Java, that's great, but it probably means you were doing the other languages wrong. It's easy to be snarky and tell me to "learn my IDE" (I know them all pretty well, thanks), but statements that can be so trivially turned around are most likely completely useless.)

There are a great number of Ruby and Smalltalk developers that would be more than happy to test you on "productivity" (a nebulous metric if ever there was one, and one which depends *heavily* on the application space under discussion).

Anonymous said...

I love java, why I must care about other languages when I can do my work with java and my customers happy?

Dave Newton said...

Who said you have to care about other languages or can't "love Java"?

Anonymous said...

I get you on this one. It's not about Java the ecosystem. It's the language. The syntax. How much it sucks to do some simple stuff with so many codes.

IPat said...

I agree love is very wrong word for computer language wich is simply tool to create products. Love is also suggest emotional not rational reasoning. Just simply look on the statistics:

C# vs Java job postings:

This is not love, but pure facts !

Dave Newton said...

I think it's too bad that you feel people can't have an emotional response to their tools.

What makes a programming language any different than a well-crafted wood working tool? If you don't have a passion for programming, maybe you shouldn't be programming.

James E. Ervin, IV said...

You know why you find alot of Java "hate" out there is the fact that it is being used. Any technology has its drawbacks, including whatever you think is awesome. You don't find alot of ppl writing Lisp sux, because, well, no one uses Lisp or Smalltalk or etc...

Java is taken for granted since it has been in the forefront for some time now and it has given people like me the opportunity to forget just how much of what came before it stunk. I would take writing in Java any day than going back to C/C++. The advantages that Java brings like automatic gc, threading, etc are not unique eh? You know there could be a relationship *sarcasm* worth looking into there.

I have written in Java for what will soon be a decade. I had the initial flush of wow I love this language. Over time you learn the strengths and weaknesses of the platform. It is just that the strengths tend to be taken for granted and the weaknesses are much more likely to be fodder for a rant in a blog entry. This is what I would term *sarcasm alert* "Human Nature."

As far as your "thought leaders" go, I have been watching them too. I think alot of what alot of them say is worth consideration, I have also noticed something else about alot of them, they are what you would call "technological butterflies" in the same way you would call someone a "social butterfly." They get bored with what they know, eventually get promoted away from writing actual production code and get attracted to shiny new things. Once again something I would term "Human Nature." I don't hold that against them, I want to be promoted like that one day, and I would love to get paid to pontificate, that would rule!

I am not a Java fan boy, even though I have developed on it for a while now. I too am enthralled by the shiny new things (languages) being developed on the JVM, particularly Groovy and Scala. I don't care for the boilerplate either, but you have gotta give ol' Java its due. Heck even if I write a rant blog entry on Java, don't mean I hate it, far from it. There is something to be said for using something in "anger" and learning from it.

So taking this into account, I would say your google search metrics are about as worthwhile as well, LOC is in determining the productivity of a developer, which means I don't think it has much value at all.

Dave Newton said...

You're clearly confusing the post this is a response to with my post: my point with the search criteria was that the OP's criteria weren't likely to return meaningful results.

I've been developing in Java for over a decade, and developed in Lisp, Smalltalk, C/C++, Forth, and assembly for a decade before Java. (And Basic, Pascal, and Fortran before that.)

There was never any flush of "wow, this is awesome" with Java, because IMO there isn't anything awesome about it. *Other* people might find things about it awesome, but reasonable people can disagree.

Heck, Java was *slower* than Smalltalk when it first came out, and a far less powerful language. Now Java is very fast, the Java ecosystem is huge. That doesn't mean I need to like Java-the-language.

Any due given to "Java" I'll give to the JVM (which is really nice, and will be even nicer with invokedynamic) and the libraries around it. The language itself? Meh.

James E. Ervin, IV said...

Fair enough, you are right I confused the two. Still I do get tired of all the Java sux stuff. I remember a few years back that it seemed that at least half of the Java RSS feeds were devoted to Java sux, Ruby Rules articles. In fact, I think I am indebted to Ned and his rant on Ruby, because after it all the Ruby stuff went away from the Java newsfeeds.

Dave Newton said...

Don't get me wrong--I'm not saying Java doesn't suck; IMO it does. I prefer more expressive languages. Java's missing some language features that are *very* important to me.

It's only fairly recently with the strong IE support that Java has that I'm approaching the same productivity level I had 20 years ago using Lisp and Smalltalk, but with (much) uglier code.

When it's all said and done, I don't care if people like, love, hate, or tolerate Java: everybody has their own thing.

Dave Newton said...

(That should read strong IDE support.)

James E. Ervin, IV said...

I think the phrase violent agreement is appropriate here. I mentioned before I am not a Java fan boy and that is accurate. No I am a Groovy fan boy these days and been working on its support in Eclipse. :)

Jhonatan said...

you guys gota learn one thing.... risk analisys, i mean, if you are doing a simple site u better use PHP or some other simple web language, if you are doing a big corporation system, integrated with dozens of tools like an ESB and such u gota use JAVA, or if you trying to do a virtual store with low budget and little time u better use a consistent ready to use solution like magento, wich is made using PHP, on a project like this u gota think about in wich language u can obtain cheaper human resources and cheaper enviroment, you wont use Java for a low budget project...

Java isnt aimed for productivity, it focus on quality, the language itself prevents you from doing shitty messy code, but by doing that makes the productivity fall.
my point is, u gota know wich language is better for each project you begin, choosing the language is part of the scope definition of the project, no language is good for all kind of projects.

Dave Newton said...

I think you haven't coded a web app in a modern Java framework; combined with IDE support they're pretty darn lean. Better yet, use Grails, or JRoR, and get the best of both worlds.

PHP is an abomination.

Anonymous said...

Why "PHP is an abomination" ?

Dave Newton said...

Just because you *can* do anything in a language doesn't mean you *should*. I find it aesthetically ugly, inconsistent, OOP seems "tacked on", etc.