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

  • Get Good at DevOps: Feature Flag Deployments with ASP.NET WebAPI

    They provide developers with the ability to toggle features on and off without having to redeploy code, making it easier to manage risk, test features in production, and facilitate smoother releases.

  • Implementing k-NN Classification Using C#

    Dr. James McCaffrey of Microsoft Research presents a full demo of k-nearest neighbors classification on mixed numeric and categorical data. Compared to other classification techniques, k-NN is easy to implement, supports numeric and categorical predictor variables, and is highly interpretable.

  • Building Secure and Scalable APIs in .NET 8

    Tony Champion: "From giving you access to the entire lifecycle of a request, the ability to configure and extend authentication and authorization, .NET 8 gives you the power to create APIs to meet even the most demanding needs."

  • What's New for Java Tooling in VS Code, Azure Cloud

    Java on Visual Studio Code gets a new tool to its extension pack, while Java on Azure upgraded the Azure Toolkit for IntelliJ and more in new regular updates for both properties.

Subscribe on YouTube