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 newsletter!

Or

Sign up to gain exclusive access to email subscriptions, event invitations, competitions, giveaways, and much more.

Membership is free, and your security and privacy remain protected. View our privacy policy before signing up.

Error: Please check your email address.

Tags Microsoftsoftwareapplication developmentDevelopment toolsLanguages and standards

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

Cool Tech

Toys for Boys

Family Friendly

Stocking Stuffer

SmartLens - Clip on Phone Camera Lens Set of 3

Learn more >

Christmas Gift Guide

Click for more ›

Brand Post

Most Popular Reviews

Latest Articles

Resources

PCW Evaluation Team

Michael Hargreaves

Microsoft Office 365/Dell XPS 15 2-in-1

I’d recommend a Dell XPS 15 2-in-1 and the new Windows 10 to anyone who needs to get serious work done (before you kick back on your couch with your favourite Netflix show.)

Maryellen Rose George

Brother PT-P750W

It’s useful for office tasks as well as pragmatic labelling of equipment and storage – just don’t get too excited and label everything in sight!

Cathy Giles

Brother MFC-L8900CDW

The Brother MFC-L8900CDW is an absolute stand out. I struggle to fault it.

Luke Hill

MSI GT75 TITAN

I need power and lots of it. As a Front End Web developer anything less just won’t cut it which is why the MSI GT75 is an outstanding laptop for me. It’s a sleek and futuristic looking, high quality, beast that has a touch of sci-fi flare about it.

Emily Tyson

MSI GE63 Raider

If you’re looking to invest in your next work horse laptop for work or home use, you can’t go wrong with the MSI GE63.

Laura Johnston

MSI GS65 Stealth Thin

If you can afford the price tag, it is well worth the money. It out performs any other laptop I have tried for gaming, and the transportable design and incredible display also make it ideal for work.

Featured Content

Product Launch Showcase

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?