Why I Am Not A Java Programmer

OK, anyone that reads my blog KNOWS I’m not talking about myself here. But I’m still curious about what debates folks are having out there in the software engineering world. Here’s a recent note on why Perl is better than Java. Java is now in fashion at work. Personally, I don’t notice whole lot of excitement from the engineers about Java. But they do most certainly consider C++ a “serious” language and Perl for the hack. Sorry, I know I’m putting words in people’s mouths–but sometimes you just have to generalize!

Any-who, here’s a blurb from the article that caught my eye:

To paraphrase Doug Gwyn on Unix, Perl was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.

From a managerial perspective, I hear over and over again how Java stops programmers from doing stupid things. The opposite as a plus was an interesting take I never heard before. The author’s conclusion at the end of his note follows this same message:

Perl is a concise language, designed to make it quick and easy to turn thought into code. Java is a syntactically simple and consistent language, designed to encourage good style and be easy to embed. Each has their strengths and weaknesses, but people rarely agree on which is which. People are funny that way. Some want to save you from yourself by restricting you. Some want to let you be yourself by removing as many restrictions as possible. Both are fraught with peril. I happen to like the latter peril better.

The one thing not discussed by the article was performance which is a huge issue for us at work. C++ still rules from that perspective. Handling millions of transactions per day notwithstanding, could Perl upend Java some day in popularity because of its supposed easier learning curve? I’m sure fancy professors nationwide will do everything they can to make sure that doesn’t happen. I’ve done some kindergarden Java programming back in ’96. I’ll have to try Perl out and compare ease of ramp up for myself. I’d be curious to hear anyone else’s opinions on which of the two languages they prefer.


2 Comments on “Why I Am Not A Java Programmer”

  1. Joe Goldberg says:

    [now that comments are back up, I’m adding this for Joe]
    Why I am not a Java programmer (yet)*
    yes yes YES!
    The toolkit analogy is perfect for comparing programming languages. My pre-calc teacher taught me that analogy in 10th grade and it’s stuck with me ever since. It applies in so many aspects of life, pretty much anything where skills build upon each other. Parenting, drumming, and of course web development.
    IMO here’s the crux of the argument
    The point is how easily, elegant and maintainable can you do it? When you try to shoehorn every programming task into one style [OO in Java’s case], things get ugly. I’d rather have a tool-box full of lots of different tools than one with 57 kinds of hammers.
    FWIW, I’d compare OO in java to one horkin huge hammer as opposed to 57 kinds of hammers. But the argument is still the same.
    Java and C++ programmers complain that perl is prone to hacks, but what’s more of a hack than a “hello world” program that requires classes, privacy, types, methods, and an array? The more I learn java, the more I like perl. I like this quote too: “any sufficiently encapsulated hack is no longer a hack.”
    I also miss here-docs. How can one stand to write any front-end code (e.g. outputting xhtml) or db accessing code (e.g. sql statements) without them?
    [via MoT…turn commenting on, Andrej!]

  2. Andy says:

    My biggest gripes about Perl are as follows:
    1. There’s very little consistency in the language. For almost anything that you’d want to do, there are a dozen different ways to do it. One could argue that it’s flexible, but I’d argue that it makes reading code harder.
    2. OO programming in Perl is a joke. It feels completely bolted on after the fact; at least in the 5.X… Not sure what 6.X is going to look like.
    3. I like dynamic languages and all but the fact that perl is almost entirely untyped is annoying. You can do this:
    my $val = “test”;
    print $val+1 . “\n”;
    And it prints:
    Obvious huh?
    Recently, I’ve been playing with Ruby (checkin’ to see if the Robot-Coop folks are insane 😉 and if I were going to choose something instead of Java I’d go with Ruby. As far as a language goes, it’s just great to work with… Jury’s still out on performance etc.
    My biggest Java gripes are:
    1. Being a static language you have to compile your code after every modification before testing it. This adds immense amounts of time to development.
    2. The CLASSPATH management is a complete pain. You can’t just drop a *.jar in a directory and automatically pick it up. You have to specify the *.jar in the CLASSPATH.