Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Java is different from JavaScript 1

Status
Not open for further replies.

petey

Programmer
Mar 25, 2001
383
US
The fact that Java is different than JavaScript hasn't completely sunk into all of the web design community. I still see the terms used interchangably, even in this forum.

The fact is, they are very different.

Java is a compiled programming language, so it is fast, but you must write the code, save it, and compile it into a class file for it to work.

JavaScript is a scripting language. (i.e. it is not compiled) Rather, it consists of plain text in a web page that is interpreted by a browser. JS interpretation is CPU intensive, thus JS runs slower.

Why do people get the two confused so often? Obviously because of the unfortunate name similarity, but also because they both can run in a browser. Java is loaded into a browser as a separate file called an applet. JavaScript is loaded as part of the web page text, surrounded by <script> tags.

The two languages have different syntax, were created by different people, run differently, and are used in different ways.

In fact, JavaScript was supposed to be called LiveScript, but when Java became popular the name was changed for marketing reasons.

Last of all, note that the creators of JS based some of the syntax on Java to facilitate ease of learning. For this reason, if you want to learn Java but are new to programming, JS is a good stepping stone.

-Petey
 
you know, I dont know how many times I had to tell people that X-) it almost gives you a headache after a while. Karl Blessing aka kb244{fastHACK}
kblogo.jpg
 
i've given up explaining this ... i've even got flamed once because the person asking was mixing so much java & javascript that she wouldn't even try to understand they were totally unrelated !!!!!
 
Its a never-ending struggle for Truth, Accuracy, and Correct Terminology.

(but isn't the intranet the same as the Internet? Isn't a URL the same as the file location? What do you mean, relative path or absolute path?)
 
I see that I am preaching to the choir. Tell your non-believing friends.

-Petey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top