Knowing where EcmaScript is going, it is evident that JavaScript is changing profoundly. We hit the limits with ES5, and there is a need for change that will enable much better desktop and mobile performance, as well as a more familiar development experience for programmers with sole object-oriented experience (the vast majority).

JavaScript bad cocktail of OOP and Functional features, as the major source of confusion, created an education crisis which was also mentioned by the JavaScript guru Douglas Crockford:

"There are very few programmers who know how to use the language effectively" - Douglas Crockford

If the most popular programming language on the planet, running on billions of devices, has only few programmers that know how to use it effectively, the logical conclusion is that programmers are lazy to learn about exotic language concepts (e.g. prototype inheritance), but there is also an obvious language design problem, since JavaScript has failed to bridge the gap between a human brain and a machine.

We definitely need an object-oriented, and even strongly-typed javascript.

Nooo.. Object-oriented Javascript?!

I know, object-orientation and strong-typing are not natural for JavaScript, and many will oppose it, because the "true nature" of JavaScript is prototypal and dynamic. One of the best blog articles about prototypal inheritance ever written is the one by Aadit M Shah:

Why prototypal inheritance matters

In the article above, Aadit argues that object-oriented and functional features of JavaScript don't mix well. Douglas Crockford had a similar opinion when he criticized the new operator used with constructor functions:

This indirection was intended to make the language seem more familiar to classically trained programmers, but failed to do that, as we can see from the very low opinion Java programmers have of JavaScript. JavaScript's constructor pattern did not appeal to the classical crowd. It also obscured JavaScript's true prototypal nature.

I do agree that the "true nature" of JavaScript is prototypal, but that doesn't mean that the flawed OOP features of JavaScript can't be fixed in the upcoming versions, and make it more understandable to the average programmer.

However, the language is changing and moving toward better object-orientation in ES6, it's nature is changing, and perhaps, one-day JavaScript will become a language like C# or Java where object-oriented and functional features coexist just fine. That will also resolve the educational crisis of JavaScript, which is a huge step forward.

If object-orientation and strong-typing can enable programmers to write better quality software, nobody will cry because of that. That will also improve mantainability of JavaScript applications and will unlock better performance.

One of the advocates of typed JavaScript is Victor Savkin from the Angular team, and he wrote a nice post about it:

Why Javascript needs types

ES6 and ES7 are going in the right direction to improve mantainability (e.g. modules, classes, improved async programming, arrow functions, promises). When you combine those features with a type-system, it is great material for faster runtime environments and optimized JIT compilers execution. The predictability of types will fit very well into the hidden class system used by most engines, and make the JIT compilers much more efficient at caching, which is the key to performance. The already fast Google V8 engine will be more like a V16 engine in the future!

What can you learn right now that will get you closer to the brighter future of JavaScript? TypeScript.

I know there are other ways to use future JS features (e.g. Harmony shims etc.) but their API's are less stable than TypeScript. Here is a comprehensive list of all the options available:

https://github.com/addyosmani/es6-tools

What is TypeScript?

TypeScript is something like a time-machine that allows you to use most future ES features right now, in all browsers. It does not follow the EcmaScript specification 100%, so there are some features that differ from the future ES specifications, but it compiles into 100% compatible ES5 code.

Typescript is a language (a superset of ES5), and a compiler designed by Anders Hejlsberg, the creator of Turbo Pascal, Delphi and C#. It's Very simple to use on any OS, and supporting all browsers. If you have any OO and JavaScript background you can learn it in one hour.

It is ready to use in .NET, Node.js, Angular or any other framework or library you might be using. It is proven in production and big applications have already been built with it (e.g. Microsoft Azure portal).

The TypeScript site has a nice playground where you can experiment with TypeScript directly in the browser and see how it works:

http://www.typescriptlang.org/

What does the TypeScript compiler do?

You write TypeScript code in .ts files and the compiler generates optimized, modular, nice JavaScript code that runs in all browsers. Here is an example of a .ts hello world application, a Greeter class:

Once you run the TypeScript compiler on the file above it will output an awesome JavaScript IIFE with a constructor function for the class:

The compiler itself is a command-line application with a simple API that you can run on any platform. It is also integrated in IDE's (e.g. Visual Studio) and text editors (Sublime Plugins). You can also easily run it in your CI/CD pipeline.

How can i move my existing JS to TypeScript?

Any existing JavaScript is valid TypeScript. TypeScript is just a superset of JavaScript, and it doesn't remove anything from the ES5 implementation. You can rewrite your code incrementally or use a big-bang strategy and rewrite your whole app as a TypeScript app if you like.

How do i know that my investment in learning TypeScript will pay off?

TypeScript is a tiny investment, since you can still use all existing JS features, so it's not a big risk at all to invest time and money in TypeScript.

In addition the big players are gathering around TypeScript, which proves it worth. Microsoft (the inventor of TypeScript) and Google (Baking TS into Angular 2.0 by default) are two biggest supporters of TypeScript right now.

Google retired it's own language called AtScript in favor of TypeScript, and a collaboration with Microsoft. Google likes performance, and TypeScript is a promise of a more performant future JavaScript. In addition, having big players on board is a great way to influence the future development of EcmaScript.

In addition, TypeScript will always be one step ahead of the current EcmaScript implementation, so even after ES6 gets out in the wild, TypeScript will still be a good idea, since it will be a superset of ES6 implementing ES7 features.

Conclusion

TypeScript is a good idea. For C# and Java developers it will feel right from the start, because of the strong OOP approach. Ruby and Python programmers will still prefer CoffeeScript, but eventually many will recognize the benefits of TypeScript.

When Angular 2.0 comes out later this year, TypeScript will become the mainstream, so get on board as soon as you can!