
How is JavaScript different from Java? - shawndumas
http://www.java.com/en/download/faq/java_javascript.xml
======
krisajenkins
There's a typo on the first point. Instead of, "Java is an OOP programming
language," it should read, "Java is an object-oriented OOP programming
language."

That aside, it's a wonderfully enlightening document clearly written by
someone well-versed in the issues. :-D

~~~
Kiro
"Java is an object-oriented object-oriented programming programming
language."? Not sure that I agree.

~~~
oleganza
It was a sarcasm. In original there was already "programming programming".

------
drill_sarge
>They require different plug-ins.

I wonder what JavaScript plugin is the best

~~~
MildlySerious
At least the Javascript plugins don't want me to install the Ask Toolbar when
updating.

------
Baliw
Java is to JavaScript as ham is to hamster

~~~
dionidium
As car is to carpet

* [http://stackoverflow.com/questions/245062/whats-the-differen...](http://stackoverflow.com/questions/245062/whats-the-difference-between-javascript-and-java)

~~~
frozenport
As rap to rapist?

------
olegp
I used Java for 7 years and got burnt out with programming because of the
amount of upfront design effort required. I would never start coding because I
knew my architecture wasn't abstract enough and refactoring it later would be
hard.

JavaScript was a breath of fresh air. I could start hacking without thinking
about the design, but instead focusing on simplicity and the problem at hand.
Refactoring later was trivial.

A big part of this is that whereas Java is OO, JS can start out procedural,
evolve to be OO and then go functional, all within the same project.

I'm now churning out more quality code than ever at
[https://starthq.com](https://starthq.com)

~~~
aviraldg
>> I used Java for 7 years and got burnt out with programming because of the
amount of upfront design effort required.

That is essential for any software engineering project (and is almost the
definition of `engineering`)

>> I could start hacking without thinking about the design

o.O

>> Refactoring later was trivial.

I've never heard someone say that about JavaScript -- in fact, I've heard just
the reverse. Java tooling makes refactoring much, much easier. Not so for
JavaScript.

~~~
agibsonccc
You're right. As much as people rail on java here, it still has some of if not
the best tooling in the industry.

You can make javascript pretty easy, but the process is a bit more involved
(not a bad thing to know your own code though.)

It makes me happy to be able to use sublime for all my programming but java.

That being said, I have to agree about the design though. You're only shooting
yourself in the foot if you just start coding right away. Even just 10-15
minutes of design up front to understand what the heck you're doing will save
hours down the road. I think it's more of a problem of balancing the 2.

Some people overdesign and don't get anything done while others just do
everything and end up with code rot and technical debt later.

~~~
olegp
Of course one needs to think about the problem up front, especially in
JavaScript. The problem with Java was that due to the fact that it's not
dynamic, it was easy to get carried away creating abstract base classes and
interfaces, or worse yet using generics to build up the foundation for what
you actually wanted to do, before you wrote any code that was useful.

In JS, the focus for me is to get something that gets the job done in as
simple way as possible, and then work to make it more generic.

------
cabalamat
What the page should have been:

    
    
        How is JavaScript the same as Java?
    
        They both start with the letters J, A, V, A.

------
adamnemecek
TIL that scripting languages are distinct from programming languages.

~~~
mistercow
Also that JS can only run in a browser, and that it requires a plug-in.

~~~
zeemac
Also that Java is compiled and JS is "all in text".

~~~
mistercow
That one is at least roughly accurate. It's poorly worded, but the idea it is
trying to convey is at least true.

------
rgbrgb
1998 called and wants it's "scripting languages" back.

------
shaohua
Java - Write once, debug everywhere.

JavaScript - Write once, run everywhere

~~~
10098
This should be the other way around actually.

~~~
neals
JavaScript - Write everywhere, run once?

~~~
ygra
Until the first error in the console ;-)

------
doug1001
sort of thing a high school football coach, assigned to teach computer science
over the summer, would write on the chalkboard for his students to memorize
for the exam.

------
millstone
Personally I enjoyed all the whitespace in the XML source.

Props to mozilla.org for ensuring that dinosaur of a link keeps working!

~~~
chankey_pathak
LOL you noticed it! :D

------
jelled
>JavaScript code are all in text.

Is Java bytecode not text based? If not, how would you classify it?

~~~
JosephRedfern
No, it's an array of bytes. Disassembled Java bytecode could be considered
text-based, but I'm pretty sure the actual class files are considered
binaries.

~~~
MaysonL
Of course, Java code is all binary, not at all human-readable or writeable.
And there are not compilers for Javascript (except for a few JIT compilers in
Safari, Chrome, Internet Explorer, and maybe Opera).

~~~
mbq
Actually all modern browsers and standalone interpreters like node.js have a
JIT compiler for JavaScript; and while Java's bytecode is still not a machine
code and is also JIT compiled by the Java "virtual machine", both languages
are equally "scripting" or equally "non-scripting" (wherever you want to put
the "scripting" line).

~~~
MaysonL
I guess I shouldn't have left off the <sarcasm> tag.

------
rspeer
Can we just start calling the language "JS" consistently? Other languages get
to escape from their stupidly-named origins, such as "Personal Home Page".

------
angdis
Anyone can find out how Java is different from Javascript in about 30 seconds.

What I would like to know is WHY THE FUCK JAVASCRIPT has the word JAVA in its
name?

~~~
RossM
I remember reading somewhere that it was to piggy-back on Java's popularity.

~~~
joshguthrie
In the same way CPP was only a way to cash on C's popularity.

------
mistercow
>Java code needs to be compiled while JavaScript code are all in text.

Well, one correct bullet point out of four is, uh, I guess it's better than
zero.

------
awad
Is there a historical reason the page is 'java_javascript.xml' but returns an
HTML document with text/html mime type?

~~~
jarman
They might have static xml files on server and XSLT template engine to produce
html

------
rdc12
That is one painful page

~~~
david67
TRUE, that is _all_ plain wrong, amazing ;-)

------
pan69
Didn't it have something to do with cars and carpets?

------
shire
Why is there Java in Javascript?

