What to Look for in Microsoft’s New TypeScript Language
While we are generally Linux and LAMP evangelists we like to keep an eye on what proprietary software vendors, like Microsoft, are up to from time to time. The Redstone giant, it seems, has dipped its hand into the JavaScript jar to come up with something called TypeScript. Might be interesting!
Origins
JavaScript has been one of the core applications used in HTML5. However, most developers find one drawback or another with using JavaScript; specifically because JavaScript wasn’t originally intended to be used with long applications. No one can quite say which aspects of JavaScript don’t fit in, for some it works well enough; it’s just that there are many factors that can make it a little ugly to write.
Because of this, programming languages like CoffeeScript and Google Dart have surged, but this type of scripting language doesn’t work either, as it makes changes to existing JavaScript syntax. As an agruably workable solution, Microsoft has come out with TypeScript, a program led by Anders Hejlsberg who has a long history of experience in programming mainstream languages such as Pascal, C# and Delphi.
The Purpose is to Extend
JavaScript started out very simply, as a language for the Netscape browser. It was never meant to be a language to build large-scale applications on. Yet the rise of HTML5 and the need for more robust websites made it a standard language for both client-side and server-side development. Still though, developers often have to find workarounds.
Features Like C#
TypeScript was developed as a need to fulfil large web build needs such as those required by the Bing team, a need to develop in JavaScript but have the tooling options available to languages like C# – the ability to catch errors during developer time, rename methods and fix the areas where methods and variables are used.
Browser Compatibility
Programmers who use TypeScript extend the JavaScript functionality to make their apps run more efficiently in any browser. It addresses JavaScript issues that other languages such as Google’s Dart does but without departing from the original JavaScript language so radically.
JavaScript Compatible
There is not a lot of difference between TypeScript and JavaScript. Basically, Microsoft created it as a way to help JavaScript developers who are programming on large scale projects using HTML5. The application works with existing JavaScript frameworks and libraries, so that any JavaScript programming can simply be pasted into the typescript app screen and it should have the same functionality.
Additional Features
TypeScript has a few additional features that may interest conventional JavaScript programmers including:
- Class declarations
- Optional static typing
- A visual Studio Plugin
- Support for modules
In the End
TypeScript is not a program to replace JavaScript but rather one that extends on its features, especially where programmers seem to be having shortcomings. However, in most cases, most developers seem to be sticking to JavaScript. This may be because they can’t really see the value in TypeScript, although those working on large web projects seem to use its functionality.
Will TypeScript replace JavaScript? Even Anders Hejlsberg, the lead designer doesn’t see this as happening. TypeScript is designed only to be a large-scale tool or aid, offering module systems and optional static type checking which can be compiled to JavaScript.