[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: "static" declaration
Anton van Straaten writes:
> Neel Krishnaswami wrote:
> > Haskell has a solution to this problem that feels really clean.
> > There, they call interfaces "typeclasses".
> Thanks. I'm not even remotely tempted to muster a spirited defense
> of Java against Haskell...
I'll do it, then. :)
> In the trickle-down hierarchy of languages, I see Java as having a
> few things to "teach" other mainstream languages, but I'm not sure
> that it has much to teach the Haskells, MLs etc., at least not from
> the language-theoretic perspective.
I think it does, actually. If you look at the big programs that live
out in the wilds of everyone's desktop, you'll find that they fall
into two major classes, the "big programs" and the "internal apps".
Some common features things that characterize big programs, like MS
Office, KDE, Apache, and so on, are (this is not intended to be a
o They are concurrent.
o They need to be extended at runtime.
The features that characterize internal apps are:
o They need to access relational databases.
o They need GUIs.
What both sorts need are:
o A rich collection hierarchy.
o Good network protocol support.
Now, Java supported *all* of that right at the starting gate, with
threads, class loading, JDBC, Swing, and so on all coming in the same
box. That's really important, because it meant that you could propose
writing significantly complicated applications and have a realistic
hope of being easily portable across systems.
That's amazing, and I mean that absolutely seriously. For heaven's
sake, *object serialization* worked right out of the box with Java!
That's something that has its own industry in CORBA. I could go on for
days describing things I don't like about the language, but its
designers did a really greate job of figuring out what people use to
write applications and giving it to them, and I think they deserve
praise for that.
This is not a knock on academic languages like ML or Scheme; I like
them a lot and actually use them in preference to Java. But I think
that it's important not to casually slag off Java (or Perl, for that
matter), because there's stuff to learn there as well.
This leads to a question: how do you define lightweightness? After a,
language with a monster set of libraries is not really lightweight,
but can enables people to write small programs. I bet people had this
discussion back in the day wrt Common Lisp, too. :)
> > So your program can grow in a much more organic fashion, since it
> > makes refactoring much easier to do.
> Sounds almost "lightweight", although I'm afraid I'm not quite ready
> to kick my mutation habit to get at that feature!
Me neither, but it's cool enough that some days I'm tempted. :)