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

  • Hands On: New VS Code Insiders Build Creates Web Page from Image in Seconds

    New Vision support with GitHub Copilot in the latest Visual Studio Code Insiders build takes a user-supplied mockup image and creates a web page from it in seconds, handling all the HTML and CSS.

  • Naive Bayes Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the naive Bayes regression technique, where the goal is to predict a single numeric value. Compared to other machine learning regression techniques, naive Bayes regression is usually less accurate, but is simple, easy to implement and customize, works on both large and small datasets, is highly interpretable, and doesn't require tuning any hyperparameters.

  • VS Code Copilot Previews New GPT-4o AI Code Completion Model

    The 4o upgrade includes additional training on more than 275,000 high-quality public repositories in over 30 popular programming languages, said Microsoft-owned GitHub, which created the original "AI pair programmer" years ago.

  • Microsoft's Rust Embrace Continues with Azure SDK Beta

    "Rust's strong type system and ownership model help prevent common programming errors such as null pointer dereferencing and buffer overflows, leading to more secure and stable code."

  • Xcode IDE from Microsoft Archrival Apple Gets Copilot AI

    Just after expanding the reach of its Copilot AI coding assistant to the open-source Eclipse IDE, Microsoft showcased how it's going even further, providing details about a preview version for the Xcode IDE from archrival Apple.

Subscribe on YouTube

Upcoming Training Events