JavaScript Is Not Java

Most people know by now that JavaScript is not Java, and vice versa. One of the biggest misconceptions about JavaScript is that it is similar to Java. Actually, JavaScript bears very little relation to Java. Even though it shares part of its name with Java, JavaScript is an independent client-side, loosely typed scripting language. Java is a full-blown object-oriented, platform-dependent language derived from C++. Java requires previous programming experience, whereas JavaScript is very easy to learn. Java programs are called applets and are capable of running as standalone applications on the Web. JavaScript is platform-independent and browser-dependent, and it cannot run as a standalone application. With Java, you have to pack and compile your functions and routines into a .jar or .cab file. With JavaScript, there is no compilation other than saving your script to the page. Java is also not intended to be integrated from a language standpoint, whereas this is one of JavaScript's strengths. As you can see, in many ways JavaScript is just the opposite of Java. JavaScript is not Java.

NOTE

"For anecdotal evidence on the confusion between JavaScript and Java, I offer my own personal story as I wrote this book. When I told people about writing a JavaScript book, all but the most informed ignored the 'script' and responded, 'Oh I've heard a lot about Java recently.'"

”Richard Wagner, JavaScript Unleashed

Категории