New compiler takes steps to undo the billion dollar mistake.
TypeScript, the JavaScript-based language that Microsoft devised to make developing large Web applications easier, reached its version 2.0 milestone today.

JavaScript poses certain challenges when used in larger programs. While statically compiled languages such as C#, Java, and C++ perform extensive error-checking every time the developer hits "compile," JavaScript defers all its error checking until a program is run. This means errors ranging from typos to inappropriately attempting to perform mathematical operations on non-numerical data all go completely unchecked until, potentially, an end user is unlucky enough to do the wrong thing. With TypeScript, Microsoft is aiming to introduce some of the same checking and validation that those other languages offer while still remaining compatible with, and compiling to, JavaScript.

Since its introduction, TypeScript has included new features to improve performance, enhance JavaScript compatibility, and extend the range of error checking that the TypeScript compiler performs. TypeScript 2.0 introduces a big step forward here by giving developers greater control over null values.

null, used to denote (in some broad, hand-waving sense) that a variable holds no value at all, has been called the billion dollar mistake. Time and time again, programs trip up by not properly checking to see if a variable is null, and for good or ill, every mainstream programming language continues to support the null concept.

TypeScript 2.0 brings a range of new features, but the biggest is control over these null values. With TypeScript 2.0, programmers can opt into a new behavior that by default prevents values from being null. With this option enabled, variables by default will be required to have a value and can't be set to null accidentally. This in turn allows the compiler to find other errors such as variables that are never initialized.

TypeScript seems to be winning over a good number of JavaScript developers. Google has given the project its backing by adopting TypeScript for its Angular 2 framework and for its development environment support in Visual Studio, Visual Studio Code, Eclipse, Emacs, Vim, and more. Microsoft has been running it as a community-driven open source project, too. More than 150 individuals have contributed code to the project, making it one of the success stories of Redmond's embrace of open source.