Live from Visual Studio Live!

Blog archive

TypeScript Language Capturing .NET Developers' Attention

JavaScript has been in the air at the Visual Studio Live! 2013 Las Vegas conference this week. Whether it was Steven Guggenheimer's Tuesday keynote address on modern apps or Brian Noyes' Wednesday session on the Microsoft UI technology roadmap for developers, JavaScript has been an important part of the conversation. The problem is, many .NET developers familiar with strongly typed C# are either uncomfortable with or even hostile to JavaScript's dynamically typed scripting language.

In particular, programming in JavaScript can become a challenge on larger, more-complex code projects. The lack of strong typing invites runtime errors, while the lack of namespaces and class structure make it difficult to organize and manage code as it grows.

That's where TypeScript, an open source language created by Microsoft, comes in. TypeScript is a superset of JavaScript that presents class structure and type safety for coders, helping them better manage and maintain their code. Projects written in TypeScript compile to valid, standards-compliant JavaScript code.

Ben Hoelting is a software architect at Aspenware and a C# MVP. He also led an hour-long presentation on TypeScript at the Visual Studio Live! conference on Tuesday. He said that C# developers previously aligned with Silverlight are finding themselves forced to learn JavaScript/CSS/HTML.

"Talking with many of the attendees at these conferences and at community events, I find many of them miss coding in C# and XAML. It's just easier for them," he said, noting that JavaScript lacks the tooling and syntax C# developers prefer. "I believe that TypeScript can provide the tooling and syntax to reduce the negative feelings most C# developers get from JavaScript."

TypeScript does not eliminate the need to know and learn JavaScript, Hoelting warns. Rather, it helps reduce the learning curve for C# devs and opens opportunities they might otherwise miss. For instance, TypeScript can take full advantage of powerful JavaScript libraries and APIs like Node.js, and there is TypeScript tooling for both the Sublime and WebStorm 6 JavaScript IDEs.

In addition to providing strong typing, TypeScript also promotes proper code organization -- something that can be difficult for inexperienced JavaScript developers.

"TypeScript allows for Modules [the equivalent of namespaces in .NET], Classes and Interfaces, which fit better into the SOLID principles of object-oriented coding," Hoelting explained. "It makes it easier to separate concerns in my JavaScript."

So could TypeScript win the hearts and minds of grizzled C# developers who might otherwise be hostile to the scripting language? Hoelting thinks it's too early to tell, as TypeScript remains a pre-1.0 release. Version 0.9 is currently in the works -- an alpha version could be released in April -- and promises to add support for generics and a more robust compiler architecture. You can read more about the upcoming version at Microsoft's TypeScript blog.

"Here's my opinion on TypeScript. Anders Hejlsberg [the creator of C#] and many of the other members of the C# team at Microsoft have been helping to define and develop TypeScript," Hoelting said. "That tells me that we're going to see an explosion of C# features that start showing up in TypeScript. In a year or two, C# developers are going to feel right at home inside TypeScript. That's my take on what I've seen from Microsoft."

Posted by Michael Desmond on 03/28/2013


comments powered by Disqus

Featured

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube