Should you use Typescript for your next project?

TLDR; yes.

As a C# developer, I instantly loved Typescript for its features that make object oriented programming easy. I also love that it supports a lambda syntax for functional programming (which will actually be vanilla Javascript in ECMAScript 6.) But after developing in it for a few months now I thought it was also worth pointing out the more banal reasons I think it’s worth trying for your next project.

Firstly, it is easy to get started and low commitment.

  • Your existing Javascript files are valid Typescript. Just change the extension from .js to .ts and you can start using them in your Typescript project.
  • There’s no commitment to stick to it. Typescript compiles to sensible, well structured, readable Javascript. So if you want to go back to using vanilla Javascript, you can just take the compiled files and go from there.

Then there are the pragmatic things that will make developing that bit easier.

  • Compile time errors. Fewer bugs make it to run time, and errors are quick and easy to spot, especially if your compiler is paired with an IDE that has good Typescript intellisense, like Webstorm.
  • Better intellisense. Interfaces and class definitions mean your IDE can suggest/autofill available properties and methods. C# devs used to Visual Studio and ReSharper will be well acquainted with how much time this saves.
  • Code readability. Whether your own old code, or someone else’s, it’s way easier to work out what’s going on when you have explicit typing.

What are other people’s main impressions of moving from Javascript to Typescript?

Advertisements

One thought on “Should you use Typescript for your next project?

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s