Follow Us

We use cookies to provide you with a better experience. If you continue to use this site, we'll assume you're happy with this. Alternatively, click here to find out how to manage these cookies

hide cookie message

Microsoft TypeScript graduates to Visual Studio

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

Article comments

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



Share:

More from Techworld

More relevant IT news

Comments



Send to a friend

Email this article to a friend or colleague:

PLEASE NOTE: Your name is used only to let the recipient know who sent the story, and in case of transmission error. Both your name and the recipient's name and address will not be used for any other purpose.

Techworld White Papers

Choose – and Choose Wisely – the Right MSP for Your SMB

End users need a technology partner that provides transparency, enables productivity, delivers...

Download Whitepaper

10 Effective Habits of Indispensable IT Departments

It’s no secret that responsibilities are growing while budgets continue to shrink. Download this...

Download Whitepaper

Gartner Magic Quadrant for Enterprise Information Archiving

Enterprise information archiving is contributing to organisational needs for e-discovery and...

Download Whitepaper

Advancing the state of virtualised backups

Dell Software’s vRanger is a veteran of the virtualisation specific backup market. It was the...

Download Whitepaper

Techworld UK - Technology - Business

Innovation, productivity, agility and profit

Watch this on demand webinar which explores IT innovation, managed print services and business agility.

Techworld Mobile Site

Access Techworld's content on the move

Get the latest news, product reviews and downloads on your mobile device with Techworld's mobile site.

Find out more...

From Wow to How : Making mobile and cloud work for you

On demand Biztech Briefing - Learn how to effectively deliver mobile work styles and cloud services together.

Watch now...

Site Map

* *