Benefits of TypeScript

Problem
You’re wondering if it’s worth it to use TypeScript. You want to know the benefits.

Solution
The benefits of using TypeScript are:

• A compilation step
• Strong or static typing
• Type definitions for popular JavaScript libraries
• Encapsulation
• Private and public member variable decorators

Comments
TypeScript will compile your code and generate errors that would traditionally have been missed until the JavaScript was executed. JavaScript is a dynamic language that allows variables to change their type on-the-fly. TypeScript, on the other hand, is strongly typed and does not allow the type of a variable to change. This, too, helps identify preventable bugs. For many popular JavaScript libraries, there are definition files (.d.ts) that impose strong typing on them. TypeScript provides a more traditional and easier way to define classes for encapsulation. TypeScript classes generate closures. TypeScript also provides methods for marking class variables as private, something that’s not available in pure JavaScript.

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 )

Google+ photo

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

Twitter picture

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

Facebook photo

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

w

Connecting to %s