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

Equipping JavaScript to build more complex applications, Microsoft has augmented JavaScript with a set of advanced development capabilities typically found in more mature programming languages, such as C++ and Java. These new capabilities, packaged as a JavaScript superset called TypeScript, offers static typing, classes and modularization.

"Over the last five years we've increasingly heard from customers that writing application-scale JavaScript is just too hard," said Anders Hejlsberg, Microsoft chief architect for Microsoft's C# language. TypeScript should pave the way for new ways to aid JavaScript code development, providing the basis for code prediction, superior debugging, refactoring and easier navigation through the thickets of large sets of program code, he said.

Overall, Microsoft engineers spent over two years developing this functionality, Hejlsberg said. The company released the specification of TypeScript, as well as an open source compiler on the CodePlex repository. The company also developed a TypeScript plug-in for Visual Studio.

TypeScript is not an entirely new language, but rather a superset of JavaScript, Hejlsberg said. Developers code in JavaScript, using the TypeScript parts as needed. They then run the code through the TypeScript compiler, which emits standard JavaScript.

"All JavaScript code is TypeScript code and all JavaScript libraries just work with TypeScript," said Hejlsberg. "TypeScript compiler emits idiomatic JavaScript. The resulting code runs on any browser."

TypeScript was designed to accommodate an increasing number of developers who are interested in using JavaScript to build large-scale Web applications to run in a browser, rather than on the desktop.

"JavaScript was created as a scripting language. It [wasn't designed] to structure medium- to large-scale code bases such as classes or modules, Hejlsberg said. "JavaScript is an entirely dynamic language that has no static typing, and static typing is really the thing that powers today's rich IDEs."

Static typing requires that developers assign a specific data type to each variable they create. JavaScript itself is a dynamically typed language, in which variables do not have to be assigned a data type beforehand, simplifying coding for the less experienced.

Join us:
Facebook

Twitter

Pinterest

Tumblr

LinkedIn

Google+

Answers - Powered by ITworld

Ask a Question
randomness