Microsoft TypeScript graduates to Visual Studio

TypeScript offers a way to organize JavaScript code for large programming projects

TypeScript, a superset of the JavaScript programming language developed by Microsoft for creating complex applications, is now a full-fledged member of the company's flagship Visual Studio integrated development environment (IDE).

Tuesday's release of Visual Studio 2013 Update 2 includes TypeScript as a built-in programming language for the IDE. The company has also posted the first release candidate of what will be the production-ready version of the language, TypeScript 1.0.

"Increasingly we are seeing people use JavaScript to write large applications," said Anders Hejlsberg, Microsoft chief architect for Microsoft's C# language who also helped create TypeScript.

JavaScript, Hejlsberg noted, was intended for writing smaller programs. It does less well with larger software projects -- involving hundreds of thousands of lines of code, or even a million lines of code.

"It gets very unwieldy to maintain a code base," of a large JavaScript program, Hejlsberg said. "You can't safely refactor anything and there is no large-scale structuring concepts like classes or modules."

TypeScript is very similar to JavaScript but also incorporates traditional programming language constructs such as static typing and object classes, which set the stage for advanced IDE tooling and better organization of code.

Introduced in 2012, TypeScript is not an entirely new language. It is a superset of the ECMAScript, a specification for a scripting language maintained by the Ecma International standards body. The widely used JavaScript is based on ECMAScript.

Unlike JavaScript code, however, TypeScript program code must go through a compiler--one is available as open source from Microsoft. The output is formatted as JavaScript, and that code can run on any browser, and be incorporated into any JavaScript framework or server-side technology, such as node.js.

By compiling the code, TypeScript can offer many features typically associated with more traditional programming languages, such as Java and C++.

TypeScript offers static typing, which requires developers to define the data type of a variable before using that variable. It also features generics, which allows methods to be applied on different data types.

TypeScript also brings formal class-based object oriented programming concepts to JavaScript, borrowing new class definitions from ECMAScript 6, which Ecma is due to finalize later this year. Although a programmer can create objects in JavaScript, the language offers no way of creating classes.

Incorporating static typing and classes allows the IDE to provide more support for developers, though the use of tools such as Visual Studio's IntelliSense code completion tool, Hejlsberg said. TypeScript plug-ins are also available for other IDEs, such as Eclipse and JetBrains WebStorm.

One early user of TypeScript has been Adobe. Adobe needed to create a digital publishing viewer for Windows 8. The current Windows development environment offers two ways of building applications, by using either Microsoft's XAML (Extensible Application Markup Language) and C#, or with a combination of the HTML, CSS (Cascading Style Sheets) and JavaScript Web technologies.

"The engineering team had a background in JavaScript," said Neil Enns, a senior product manager for digital publishing at Adobe. They also knew, however, that writing a large program in JavaScript could be problematic. There are a number of tools to help in large-scale JavaScript development, such as CoffeeScript and Falcon.js, but Adobe preferred TypeScript because it could be run from within Visual Studio.

Microsoft has also been using the language in-house for projects such as Monaco, a Web-based version of Visual Studio under development.

"It was pretty clear that even though TypeScript was still early in its development, it was something that could give us good benefits," Enns said.

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 the PC World newsletter!

Error: Please check your email address.

Tags Development toolsapplication developmentLanguages and standardsMicrosoftsoftware

Our Back to Business guide highlights the best products for you to boost your productivity at home, on the road, at the office, or in the classroom.

Keep up with the latest tech news, reviews and previews by subscribing to the Good Gear Guide newsletter.

Joab Jackson

IDG News Service
Show Comments

Essentials

Microsoft L5V-00027 Sculpt Ergonomic Keyboard Desktop

Learn more >

Lexar® JumpDrive® S57 USB 3.0 flash drive

Learn more >

Mobile

Lexar® JumpDrive® S45 USB 3.0 flash drive 

Learn more >

Exec

HD Pan/Tilt Wi-Fi Camera with Night Vision NC450

Learn more >

Audio-Technica ATH-ANC70 Noise Cancelling Headphones

Learn more >

Lexar® JumpDrive® C20c USB Type-C flash drive 

Learn more >

Lexar® Professional 1800x microSDHC™/microSDXC™ UHS-II cards 

Learn more >

Budget

Back To Business Guide

Click for more ›

Most Popular Reviews

Latest News Articles

Resources

GGG Evaluation Team

Michael Hargreaves

Windows 10 for Business / Dell XPS

I’d happily recommend this touchscreen laptop and Windows 10 as a great way to get serious work done at a desk or on the road.

Aysha Strobbe

Windows 10 / HP Spectre

Ultimately, I think the Windows 10 environment is excellent for me as it caters for so many different uses. The inclusion of the Xbox app is also great for when you need some downtime too!

Mark Escubio

Windows 10 / Lenovo Yoga

For me, the Xbox Play Anywhere is a great new feature as it allows you to play your current Xbox games with higher resolutions and better graphics without forking out extra cash for another copy. Although available titles are still scarce, but I’m sure it will grow in time.

Kathy Cassidy

STYLISTIC Q702

First impression on unpacking the Q702 test unit was the solid feel and clean, minimalist styling.

Anthony Grifoni

STYLISTIC Q572

For work use, Microsoft Word and Excel programs pre-installed on the device are adequate for preparing short documents.

Featured Content

Latest Jobs

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?