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

  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

  • .NET 9 Preview 3: 'I've Been Waiting 9 Years for This API!'

    Microsoft's third preview of .NET 9 sees a lot of minor tweaks and fixes with no earth-shaking new functionality, but little things can be important to individual developers.

  • Data Anomaly Detection Using a Neural Autoencoder with C#

    Dr. James McCaffrey of Microsoft Research tackles the process of examining a set of source data to find data items that are different in some way from the majority of the source items.

  • What's New for Python, Java in Visual Studio Code

    Microsoft announced March 2024 updates to its Python and Java extensions for Visual Studio Code, the open source-based, cross-platform code editor that has repeatedly been named the No. 1 tool in major development surveys.

Subscribe on YouTube