Microsoft augments JavaScript for large-scale development

In an extension to JavaScript, Microsoft provides static typing, classes and modularization

By , IDG News Service |  Software, JavaScript, Microsoft

With static typing, however, the compiler can provide more detailed reports on coding errors, as well better predict what the program might need, because it can determine the type of data a variable should be assigned. In Visual Studio, for instance, TypeScript will allow IntelliSense to anticipate what coders need when writing JavaScript, to a similar degree that IntelliSense does now with C# and other statically typed languages.

TypeScript's type annotation is flexible as well. Developers can add type annotations only where they want it, to their own code, or to specific libraries.

In addition to static typing, TypeScript also offers modularity and the ability to do class declarations, both following the specifications now being settled on by the developers of the next version of ECMAScript, the standard reference upon which JavaScript is based.

Classes will allow developers to reuse existing functionality in the program. Modularity can help them organize large codebases, as well as make it easy to swap in updates to one part of the code with little impact to other parts of the program.

Microsoft is not the first company to tackle the problem of making JavaScript more robust. Google has also confronted the shortcomings of JavaScript for complex application development, most notably by developing a new language to handle more complex Web applications, called Dart.

TypeScript could be advantageous over Dart in that it does not require developers to learn an entirely new language. Rather they can continue to use JavaScript and just learn the specific rules around the TypeScript language, Hejlsberg said.

Another potential advantage to TypeScript is that no new technology is needed on browsers, given that the finished TypeScript code is compiled into regular JavaScript, which then can be run on any browser. TypeScript carries no additional performance lag on runtime, due to the fact that the TypeScript additions "compile away," said Hejlsberg.

The TypeScript specification is available, at no cost, under the Open Web Foundation OWFa 1.0 Specification Agreement, and Microsoft is seeking community consultation for further development. The compiler is licensed under the Apache 2.0 license.

Joab Jackson covers enterprise software and general technology breaking news for The IDG News Service. Follow Joab on Twitter at @Joab_Jackson. Joab's e-mail address is Joab_Jackson@idg.com

Join us:
Facebook

Twitter

Pinterest

Tumblr

LinkedIn

Google+

SoftwareWhite Papers & Webcasts

Webcast On Demand

HP DevOps KnowledgeVault

Sponsor: HP

See more White Papers | Webcasts

Answers - Powered by ITworld

ITworld Answers helps you solve problems and share expertise. Ask a question or take a crack at answering the new questions below.

Ask a Question
randomness