facebook
Nataliya Muriy
Marketing Content Creator - you name it, she'll write it!
Posted on Jun 14th 2017

Building a desktop application with multiple threads is a challenge not everyone is up to. No problem for TypeScript, though! All the pieces must fit in perfectly to make sure an application doesn’t crash due to even a tiny mistake. For this reason, folks at Slack (and many others) have put their faith in it. How is this made possible? Felix Rieseberg explains the details in his blog: static type checking, compiler, and a new level of committing.

moving-to-ts-1-cropped

First of all, we, humans, aren’t perfect, so when it comes to trusting our brains to document and correctly update documentation for complex systems (with their endless array of modules and dependencies), we’re looking for trouble. Breaking a function, unfortunately, isn’t impossible, even if you never open a file it’s hosted in.

This is where static type checking comes in. Code behavior at runtime is not affected while the code itself is analyzed. What the type checker does is try to infer types, as much as possible, to give the developer a timely warning about any situation that needs attention. It also supports the system by allowing manual type declaration — essential in making any program understandable.

 

moving-to-ts-2-cropped-more

 

Finally, committing code is no longer a guessing game. You, the developer, can now trust your code even more: TSLint checks all of the staged code automatically to make sure it lives up to the linting standards, before Git commits any changes. In Slack’s team’s case, all of its code must state the type whenever it cannot be inferred by TS.

When a branch needs to be pushed, the entire codebase is run against TS compiler and thus analyzed for any errors on the structural and functional levels. At the same time modern features, such as async/await into ES2016-compatible code, are transpiled. Therefore, the code and its structural dependencies are completely trustworthy by the time a Pull Request is opened.

 

moving-to-ts-3-cropped

Developers at Slack aren’t the only ones that have recognized TypeScript’s supremacy. As mentioned in the Quora forum, companies ranging from Microsoft itself to Capital One and Accenture, have come aboard.

What are you waiting for? You could try it with our Angular IDE, which now gives support to TS 2.2. It can also be used with our Webclipse plug-in and MyEclipse IDE. It’s time for a much more pleasant coding experience!

If you have any comments or questions, we would love to hear from you @Webclipse on twitter or via the Webclipse forum.

Not currently subscribing to our blogs? Subscribe now and we’ll let you know as soon as new blogs are available.