Guides to Programming Languages & Related Topics



Javascript is not Java

They are completely different programming languages. Javascript was developed at Netscape (in the mists of time, the 1990s, before Chrome and Firefox and Safari there were only two popular web browsers - Internet Explorer and Netscape). Author Brendan Eich was told that the new scripting language should look like Java. Oh, and it had to be finished in ten days time.

In the mid-90s, Java was the exciting new programming tool that was whipped into a technical marketing frenzy. Not only was Javascript (originally named Livescript) meant to look like Java, it was decided later it should have a similar name too. This gave Javascript an major promotional boost. Of course the similar names caused confusion but as a marketing tactic it worked.

Internet Explorer adopted it

In 1996 Microsoft added Javascript support to version 3 of Internet Explorer. Which shows how quickly Javascript became widely successful. This cemented its success as both the main web browsers on the planet now used Javascript. Microsoft later had to rename their version to JScript for commercial reasons.

If it's not related to Java, what is it?

Typically Javascript runs on the web browser. That's not its only domain, but Javascript runs on every web browser and most web pages contain some Javascript. Which makes it very likely the most widely used type of software code. Early scripts would for example perform simple animations, or validate a user has entered a date correctly. The web browser on a phone or a laptop is "client" or "user" side. The web site is the server ("server" side). As implementations of javascript have improved javascript is becoming more popular on servers rather than just client side applications. Since the 2000s decade, many Javascript libraries (such as jQuery) have become popular to deal with differences in the way browser handle web pages say, or simplifying production of more complex animations, or producing widgets such as a date picker rather than typing a date manually (sooo last millenuim).

Was it really written in just ten days?!

Yes. Of course it was hurried and there are some awkward quirks which remain to this day (the plethora of 'falsy' values for initialisation is one example). There are genuine security concerns with careless use of Javascript. And different browsers have some incompatibilies in their browser implementations. Some members of the standards commitees that decided what the standard Javascript should be had a vested interest in preserving the buggy parts of javascript to permit already written code to remain working. There are also some very good features in Javascript which have helped it become sucessful.

What are the good parts

It's simple and easy to write code with. Conceptually it's a lot easier than Java, C or C++ programs. No memory management and it's type system is simple to work with. It's object model is fundamentally different to traditional OO languages such as Java. This makes it easier to relate objects to each other and work with objects and thier properties. Its functions are fully incorporated into its OO model which gives it some useful and very powerful features (aka functional programming).

Server side Javascript

Since 2009 when the server based I/O library node.js (native javascript does not have any capability to do I/O such as read from or write to a file) was released, a burgeoning community of developers have been writing node.js programs which for example facilitate the delivery of web content. Many companies (Microsoft, Walmart, Paypal, Yahoo) now use server side javascript to develop software.


Post a comment

Just Curious Guides to Technology