java follies [was: PHP vs Perl (Put on flame proof gear)]

Bryan Sant bryan.sant at gmail.com
Mon Mar 20 12:24:17 MST 2006


On 3/18/06, Charles Curley <charlescurley at charlescurley.com> wrote:
> Not only that, but they have to re-invent every wheel in the universe,
> because the wheels have to run on the JVM. Why?

Because the JVM is slow at calling out to native code.  It is
completely possible, but it is less portable, and often times slower
than just running byte-code (which is compiled to high-performance
platform specific machine code just-in-time).

I beleive this is the biggest reason that many don't like Java.  Java
plays an exclusive game.  You either play in the JVM world or not at
all.  I don't find that to be a big deal, but if you've invested a lot
of time learning the GTK+ API or Berkely DB or whatever, only to find
out that linking to that native code is frowned on in the Java world,
you get turned off.

> In other words, Java is object oriented Ada. Exactly so.

Sticks and stones.

> I'm in the process of learning Java, and the verbosity is
> excruciatingly painful. And without #defines, there is no way to use
> macros to reduce the verbosity of oft-repeated snippits.

#defines are a nightmare.  That has to be the single best thing the
java did when copying C/C++ is the leave out #define.  C++ introduced
type-safe constants to avoid using #define.

As far as java being verbose, it's about on par with object-oriented
C++ code.  You'll never have a type-safe language that's as compact as
a dynamic language because you're always declaring types.  It's a
trade-off.  However, with a modern IDE, the task is trival.  And you
make up any time that may have been lost (I don't believe that any is
with an IDE), by avoiding many runtime errors that the compiler finds
for you.  As well as avoiding the need to write hundreds of unit tests
that do little more than validate type-safety because your dynamic
language of choice doesn't do so.

So, actually, when you factor in the time to write type-safe-ish unit
tests for your ruby or python project, you're actually more verbose
than Java.

> And there does not seem to be any simple way to do anything. Well, not
> entirely true: interators are cute. But are iterators there because
> the Java designers don't trust you to write a loop correctly?

That's a broad brush.  But if you're looking for cute little Wow!
language features or syntax, then Java ain't it.  If you want solid
readable and maintainable code, then Java may be right for you.

> I was horrified to find that O'Reilly's idea of a Nutshell book on
> Java is 1200+ pages, and again to find that it is incomplete.

Yes, java is very complete.  I would say that this is it's largest
strength.  The libraries and frameworks are awesome.

-Bryan



More information about the PLUG mailing list