TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Difference between JavaScript and Java?

4 pointsby redxbloodabout 11 years ago
The first thing people do when they are learning is think that these two languages are very correlated because of the Java prefix. But, i&#x27;ve heard they are not? I know Java, and i&#x27;m learning Javascript, and so far they are very similar at a glance...<p>So, what are the similarities and differences between them? Why the similar name? And if anyone can give me an easy definition of script that would be cool..

5 comments

chewxyabout 11 years ago
The language is actually called ECMAScript. It&#x27;s in its 5th version right now. As its name suggests, it is standardized by ECMA.<p>JavaScript is a name that is licensed to Mozilla by Sun Microsystems. Technically speaking, only Mozilla can use the name &quot;JavaScript&quot;. The Microsoft version used to be called JScript. The Adobe version is called ActionScript (ActionScript eventually turned out to be its own sorta language that vaguely conforms to ES standards).<p>Because ECMAScript is just a specification, it is up to the implementors to conform or not to the spec. Mozilla itself does a lot of weird stuff that doesn&#x27;t actually conform to the spec. But for the main uses, all three major engines(V8, Spidermonkey and Chakra) are all pretty okay.<p>If you learn JS for use in node.js, then you are mainly learning the quirks of V8&#x27;s implementation (of which thankfully are minimal). You may think that V8&#x2F;Chrome is the dominant JS engine out there, but there are some softwares like CouchDB which uses SpiderMonkey as its engine.<p>In the past, I believe there used to be a mini language out of Java, also called Java Script, but that quickly fell out of use.<p>JavaScript as a language was designed to look similar to Java, to catch on the Java-is-the-best-thing-since-sliced-bread bandwagon in the early 1990s. Of course, when you mix paradigms, you have weird shit like ASI in JavaScript.<p>source: I am writing a couple of books about JavaScript.
lsiebertabout 11 years ago
They are utterly different.<p>This is a topic that is well documented. You can check the wikipedia pages for both Java and javascript.<p>Alternatively check this <a href="http://stackoverflow.com/a/245069" rel="nofollow">http:&#x2F;&#x2F;stackoverflow.com&#x2F;a&#x2F;245069</a>
CyberFonicabout 11 years ago
The &#x27;Java&#x27; part was due to marketing push on the part of Netscape. At the time Java was already well established and &#x27;LiveScript&quot; didn&#x27;t quite have the same recognition. What&#x27;s more, originally Brendan Eich modeled this new language on the concepts in Self and Lisp. But again, the marketing PHB&#x27;s forced him to adopt a curly bracket notation like that of C, C++ and Java.<p>Furthermore, Java is a compiled language, whilst JavaScript is an interpreted language (with lots of JIT tricks in some implementations, e.g. V8).<p>Once you start digging deeper you&#x27;ll notice that other than the superficial similarity due to the curly bracket, C-derived syntax, they are extremely different languages. Even the &quot;class based&quot; and &quot;prototype based&quot; core paradigms are very different. Of course, with Java being first, a lot of folks are trying to force JavaScript to be like Java, e.g. writing code with classes - which is a kludge at the best of time.
gumballheadabout 11 years ago
Compiled vs interpreted, strongly typed vs dynamically typed, object-oriented vs functional, to name a few.
auslegungabout 11 years ago
In addition to what Isiebert said, if you&#x27;re a book person, read javascript, the good parts <a href="http://www.amazon.com/JavaScript-Good-Parts-Douglas-Crockford/dp/0596517742" rel="nofollow">http:&#x2F;&#x2F;www.amazon.com&#x2F;JavaScript-Good-Parts-Douglas-Crockfor...</a>.
评论 #7302843 未加载