Lets not to get confused, JavaScript is not JAVA.

Standard

Most of us, the programmers are less confused about JavaScript brand name, we can figure out quickly that JavaScript is a completely different language than Java, once we start using it.

On the other hand, people who are first introduced to the language; mostly end users or clients are more confused about JavaScript sometimes, the perception or first impression of the language based on its name, is that it is a subset or another flavor of Java. That actually turned out to be a good thing for us and we got lucky to get paid for just explaining the differences and resolve the confusion to clarify to that there is no relationship whatsoever between the two, it is just a weird intruder instance of “Java” word that stuck in a brand name of a totally different language.

So here is part of the historical story on how we ended up with this mess of naming conflicts or intentional mix.

JavaScript is invented by Brendan Eich at Netscape (now Mozilla)The language originally known as Mocha then changed to LiveScript and finally it becomes JavaScript which happened to be the most controversial language name in programming history (though I like the name). Is might be the marketing team who decided to have the Java word in the brand name of JavaScript to push it out the door and takes part of that the glory that surrounded Java language at that time.

Java was getting popular and viral for its portability and flexibility during that time on both the server and client environments. Web browsers supported Java through Applets (local Java run inside a web browser). So JavaScript was meant to be a lightweight complementary language that is easier to learn and pick up by beginners to develop dynamic web content without the need to use Applets or learn Java.

To pour more confusion to the mix, Microsoft has its own implementation of JavaScript called JScript because they did not want to run into trademark dispute problems. So here we go, we have now JScript and JavaScript which represent the same core language but in different dialects.

Netscape worked on standardizing the language specification through Ecma International (an international standards organization for information and communication systems). The standard number for the specification is “ECMA – 262 Specification”. Obviously neither Microsoft nor Sun Microsystems (who own the license for the JavaScript trademark) were willing to give up or donate the trademark so Ecma through its own innovative naming creativity came up with another name!! and they called the language ECMAScript which Eich sarcastically commented about its name saying: so they ended up inventing ECMAScript, which sounds a little like a skin disease”.

ECMAScript is used now more to refer to the standard edition of the JavaScript language, and JavaScript is still the common used name to refer to the dialect implementation of the language. Since then both the standard committee and dialects implementers of the language feed each other and (try to agree) to enhance the standard language and enrich its features which eventually reflected in new editions of the standard and its new dialects implementation version, with that cycle the language continued its evolution since then.

below diagram is some sort of an object oriented diagram (hope the abstraction makes sense) of how Ecma organization, the standard, ECMAScript and various dialects are related.

image

JavaScript is a standalone language and has nothing to do with Java language except that it uses some of the design concepts and programming style, in reality JavaScript major influence came from Scheme, Self and C programming languages.

Also Java compiles eventually to a native code (sort of) that can be executed by its own JVM and runtime while JavaScript needs a host environment in order to run and execute (like a web browser or Node.js process in case of Node network applications) and it depends on its host for IO operations.

I always try to embrace and talk about the powerful features of the language like dynamic typing, closure, Lambda, and its prototype-based aspects which are design concepts and features brought from other languages like Scheme, Self, C and Java too which collectively may exceed the capability of those individual languages in certain scenarios.

I also try to expose how the language got standardized, matured and grown in recent years. By doing that I hope I can change the inherited dominant wrong perception of the language which is: JavaScript is a scripting language at the end so its not as fast and powerful as other native languages. Sometimes bad names or nicknames have really terrible consequences on things!!.

That being said, JavaScript has some inheritance of bad features and practices that sometimes make it harder for developers to maintain and spot silent errors at compile time and can only be discovered at runtime during program execution; but those errors can be minimized and totally eliminated by following best practices and design patterns that protect the application or program from language design and implementation flaws.

Also there are some code analysis tools like JSLint that helps writing standard code that follow best practices and help eliminating using a language feature or construct that might cause problems at runtime.

I intentionally did not put any timeline or associated dates to when those different evolutionary steps happened to the language because there are many resources online and references that talk in depth of the history of the language. I listed below the resources that I used for this post in case your inner history nerd wants to dig into further details.

Happy Coding!

The reason I’m getting obsessed with JavaScript

Standard

The main reason that I’m taking JavaScript seriously is that I got inspired by the rapid adoption of JavaScript and the related evolved vibrant frameworks built on top of it, in addition to that, the attraction and support JavaScript is getting from both the open source community and the majority of cooperate software companies a like.

I was amused by the language and its features when I started learning and experimenting with Node.js networking platform that is based on JavaScript event loop concurrency model. I got hooked instantly on Node.js lean approach to develop scalable lightweight server applications and its use of Google V8 JavaScript Engine and adoption of JavaScript as the main programming language for the platform. Until recently JavaScript was only popular and always attached to client side environments and never thought to be leveraged by server platforms.

But the main pragmatic reason I choose JavaScript over other languages is the vibrant ecosystem and frameworks build on top of it. It appeals to me the fact that I can use one portable language that is platform independent and spans both the client and server platforms cohesively which does not require a mind shift to switch between two different languages which is the case with the current traditional web applications development (use a different native language on the server “i.e. C#, JAVA ..etc).

The JavaScript and related frameworks had been always the de facto portable programming language and platform running on client side. But the JavaScript users took an innovative leap steps recently to be adopt and leverage it beyond the browser support and use it as a viable option to develop applications that can run on a server platform (in the case of Node.js); and also to develop native applications that run outside of the browser (for example in the case of Windows 8 applications). Microsoft also supports JavaScript language to write Map/Reduce jobs that run on Windows Azure HDInsight Service which is an implementation of Apache Hadoop running on Azure.

Netscape the company that invented JavaScript worked with ECMA International to standardized the language under the name ECMAScript. With the latest stable release of ECMAScript 5.0 standard and the rapid support by modern web browsers with the parallel evolution of HTML5 API, JavaScript becomes no longer a scripting language living in the web browser focusing only on dynamic interactions; it becomes a powerful tool to build modern web applications and be part of a vibrant ecosystem and platform that empower both the client and server environments seemingly. it makes the programming experience a more cohesive and consistent process.

I believe JavaScript has a promising future and it is happening now already and for that I got inspired to learn it and experience its capabilities and the mechanics of its vibrant ecosystem.

My core experience in the last years has been in .NET platform and C# language, I also used VBScript, VB.NET, C++ and even FORTRAN and Pascal in collage but something about JavaScript dynamic nature and portability is appealing. I can relate to it more than other languages though they can be more sophisticated and faster at runtime but I see it more relative to the real world and how it functions, its treatment of functions as first class citizens and its dynamic nature makes it closer to our brain functional model that depends on input/output to process and model data rather than objects abstractions through inheritance and hierarchical relationship as it the case in traditional object oriented programming languages.

The evolution of JavaScript is happening beyond the competition of major players in the software industry as it was born around the same time the internet was born so it becomes part of the web platform DNA and since then it continued to be implemented in each new generation of web browsers as a the default language regardless of the web browser brand or type. Its ECMAScript standards compliance assured portability and enforced consistency to some extent across all browsers and platforms, mutations may happen during its life-cycle of the language evolution but it always picked up by ECMA and everyone rush to catch up and support new emerged features. Its becoming a win win case for competitors to support it in their ecosystems and development platforms, it raises above their proprietary languages and technologies. And this by its own makes it a sustainable programming language that provides a safe heaven for programmers at least for the near future.