An Introduction to JavaScript and Java: Similar Names, Different Functions

Unless you are a web developer yourself, you wouldn’t be blamed for thinking that Java and JavaScript were related.  In fact, people conflating the two languages has almost become an inside joke among web developers.  In fact, there is an entire website devoted to educating and reminding people that there is a significant difference.  The site bears the humorous mnemonic phrase coined by notable web developer Jeremy Keith: “Java is to JavaScript as ham is to hamster.”    

While both languages have extensive uses on the web what they are and what they do couldn’t be more different.  If you’re building a site for your business, you’re likely going to be working with a web developer and understanding some of the fundamentals of web development (at least in the form of terminology and concepts) will make your experience designing your site more efficient and simple for both you and your developer or development team.

 Understanding Java

Java belongs to a type of programming language known as a general-purpose computer programming language.  It was designed to follow the simple mantra “write once, run anywhere,” which is sometimes abbreviated as “WORA.”  What WORA means is that compiled (completed and processed) Java code can be run on any system that supports the language.

In all likelihood, during your everyday computer use, you’ve probably been pestered by a Java updater on your computer asking you to update Java and restart your computer.  Those updates are necessary because nearly every system in the world works with Java now, giving incredible depth to the WORA mantra.  The Java Runtime Environment, which interprets and allows Java code to run, is included with every major operating system.

Java was designed originally in 1991 by James Gosling.  Sun Microsystems picked up the language and released the first fully usable version in 1995.  Java is now owned by Oracle Corporation, which bought out Sun in 2010 and has provided support for the language ever since.  The language became incredibly popular following its launch, as its versatility for web applications was and is remarkable.  As of now, Java is one of the most popularly used programming languages, being used in some form by an incredible percentage of websites.

Java’s usefulness comes from the philosophy of its design; the five goals set out for the language were to ensure it would be simple, secure, portable, high-performance, and dynamic.  The incredible amount of talent working on the development of the language over the years has helped ensure these goals were fulfilled.

Understanding JavaScript

JavaScript, unlike Java, is not a general-purpose computer programming language but is instead an interpreted programming language or scripting language.  What this means for JavaScript is that it operates on top of other frameworks to automate, improve, and manage specific tasks on the web.  JavaScript is largely responsible for website interactivity and is considered to be one of three core languages that enable the World Wide Web to exist as we know it.  Alongside JavaScript is HTML and CSS, both of which handle other vital portions of web design and development.

The history of JavaScript as a language began with the rise of the first popular web browser utilizing a graphical user interface.  Competition between development teams working on new, competing web browsers led to the realization by Netscape Communications founder Marc Andreessen that something was missing from web design when using HTML alone.  The problem that had arisen as companies like Netscape worked to develop better web browsing technology was that there was no easy way for web designers and developers to implement components of the web browsing experience like images, plugins, and, later, videos.

Netscape found their solution in the recruitment of Brendan Eich, who would go on to create a prototype language on incredibly short notice that would work smoothly with Java, which was rising in popularity at the time.  In development, JavaScript was known as “Mocha,” then was named “LiveScript” at release and later renamed to JavaScript.  The naming of the scripting language, which worked well with but was independent of Java, caused some industry confusion; however, the choice in name did succeed at helping the language ride to popularity on the coattails of Java’s widespread use.

JavaScript is now largely considered to be a universally-supported language, with every web browser in use including native JavaScript support.  Many of the components of the web we use every day are made possible because of JavaScript, and most websites utilize JavaScript heavily for multiple applications.

As you can see, the actual function of each of these two similarly-named languages is very different.  While their history is certainly intertwined, they are independently powerful and useful languages that serve notably different purposes.

Nixa.ca aims to help eCommerce entrepreneurs gain the leading edge over the competition with superior site design and development.  If you want to learn more about working with a professional, specialized development team, visit www.nixa.ca today!a

At Nixa, we are passionate about design and new technologies. We would be glad to share our passion with you.

Contact us