Understanding TypeScript

In many ways, it’s useful to think of TypeScript on its own merits. The TypeScript language specification refers to TypeScipt as “a syntactic sugar for JavaScript.” That’s true and probably an essential step in reaching to the language’s target audience—client-side developers currently using JavaScript.

And you do need to understand JavaScript before you can understand TypeScript. In fact, the language specification (you can read it at bit.ly/1xH1m5B) often describes TypeScript constructs in terms of the resulting JavaScript code. But it’s equally useful to think of TypeScript as a language on its own that shares features with JavaScript.

For example, like C#, TypeScript is a data-typed language, which gives you IntelliSense support and compile-time checking, among other features. Like C#, TypeScript includes generic and lambda expressions (or their equivalent).

But TypeScript, of course, is not C#. Understanding what’s unique about TypeScript is as important as understanding what TypeScript shares with the server-side language you’re currently using. The TypeScript type system is different (and simpler) than C#. TypeScript leverages its understanding of other object models in a unique way and executes inheritance differently than C#. And because TypeScript compiles to JavaScript, TypeScript shares many of its fundamentals with JavaScript, unlike C#.

View Original


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Blog at WordPress.com.

Up ↑

%d bloggers like this: