From: Joost Diepenmaat on
Prisoner at War <prisoner_at_war(a)yahoo.com> writes:

> On Apr 18, 10:44 am, Erwin Moller
> <Since_humans_read_this_I_am_spammed_too_m...(a)spamyourself.com> wrote:
>>
>>
>> Yes, but its real force is serverside these days.
>
> Yeah, I was getting that feeling! Thanks for the confirmation. But
> then again, there are so many server languages...I'm surprised Java's
> held on. Why so many languages if they all do the same thing??

*gross simplification*: java was explicitely designed to appeal to C++ and
C programmers (a large set of the professional application and systems
programmers at the time), and it was backed by a very large company.

Also, languages are not at all the same, and many languages don't have
the same "target". Javascript for instance was initially designed to be
an extension language for the netscape web browser, where IIRC Java was
designed to be used for embedded systems and application
programming. Java was certainly not designed from the outset to be one
of the big server-side languages of the web (the web hardly existed at
the time).

>> If you compare java to JavaScript, you just don't know what you are
>> talking about.
>
> I know they're different "technologies," but they're similar in this
> one little respect: they're both supposed to make the web more
> "interactive" but while Java's vastly more powerful I as a layman
> haven't seen anything besides games and educational applets.

Java is vastly more powerful than javascript, but javascript is much
more light-weight, easier to implement, far more widely supported and
easier to secure than java applets. And, as I implied above, Java really
wasn't designed for applets.

--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/
From: Joost Diepenmaat on
Joost Diepenmaat <joost(a)zeekat.nl> writes:
> Java is vastly more powerful than javascript, but ...

Just to correct myself; this isn't really true if you look at the
languages by themselves. You can definitely make the case that
Javascript is more powerful than java (and I would make that case), but
as far as "client-side" programming goes, java does have an edge, just
because it has a much larger set of library routines which includes
stuff that's just not possible to do in today's browser-based javascript
(sockets, as someone mentioned here, are just one example).

--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/
From: Joost Diepenmaat on
Lasse Reichstein Nielsen <lrn(a)hotpop.com> writes:

> Prisoner at War <prisoner_at_war(a)yahoo.com> writes:
>
>> Not to get into a programmers' rugby scrum over favorite languages
>> here, but how's JavaScript "more powerful" than Java???
>
> How do you measure "power" of a programming language at all?
>
> There is "computational power", but both are Turing-complete, so that's
> moot.
>
> There is "expressive power": How easy do you express what you mean?
> I.e., how short, but still readable, can you express the solution
> to a problem.

That's the "power" I meant.

> I can't say which one wins here. Closures in Javascript and classes in
> Java are both good at this. The greater standard library of Java
> increases the expressive power whe dealing with non-trivial
> algorithms, by introducing more "primitives", but Java is more verbose
> too.

And not only is java more verbose by default, it's also impossible
(without a preprocessor or custom compiler, but that would be cheating)
to decrease its verbosity in certain key areas. I'm thinking especially
about closures - java doesn't (yet?) have them, and you have to emulate
them via instances of explicitly defined custom classes. On the other
hand, it's relatively easy to mimic classes in javascript with syntax
that's probably just a bit less verbose than java's (without going into
the general merit of doing so).

Al said though, I still think javascript is much more verbose than it
could have been.

> Any other powers? :)

Dynamic typing is a bit win usually. Especially combined with some sort
of OO system. OTOH, having an overly static and explicit type system
definitely helps with static analisys tools (think code completion).

J.

--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/