days
-1
-3
hours
0
-8
minutes
-3
-5
seconds
-1
0
search
What makes TypeScript so trendy

TypeScript: Everyone’s type of JavaScript

Tanya Kumari
© Shutterstock / MaDedee  

TypeScript stole our hearts last year. It was just an infant when it managed to become the leader in the JavaScript ecosystem. But what is it exactly that makes TypeScript so popular?

JavaScript is popular. There is hardly any doubt about that. Ask any developer and they will instantly choose it over any other old-day language, say Java.

All is going well for JavaScript; Node, React and Angular are continuously working towards revolutionizing the web & mobile space: Vue.js is new but rocking, deeplearn.js has successfully brought Machine Learning to the browser…the list goes on and on.

But there is a branch of JavaScript that undoubtedly reigned 2017 TypeScript.

If you are a JavaScript enthusiast, you must have stumbled across the technology behemoth that is TypeScript. Yep, a monster. How else could you name a framework gathering over 7.5 million downloads per month on npm?

What’s more, TypeScript has a long list of achievements under its belt; there is a reason why it is called the ‘undisputed’ leader of JavaScript despite being only 5 years old. DefinitelyTyped, a repository for high-quality TypeScript type definitions, reached 4,600 contributors for over 3,600 packages in 2017.  It was also declared #3 on Most Loved programming languages in StackOverflow’s 2017 survey.

SEE ALSO: JavaScript ecosystem members Angular, TypeScript & Meteor are a safe bet

2017 was definitely a good year for TypeScript which then, may or may not, has been helped by Google’s decision to build Angular 2.0 with TypeScript. Then frameworks like Ionic, Aurelia, NativeScript, and more started adopting this typed JavaScript version. As a result, there was a sudden hype amongst enterprise developers, who undoubtedly liked the appeal of this language (if download rate is any indicator).

So, what is so appealing about TypeScript? I did a thorough research, asked a few of my fellow developers to tell me why this particular language stood out to them as well and they gave me some great responses.

You may be surprised at how long the list of reasons why TypeScript is a top trend amongst JavaScript Developers can get. But fear not, I have compiled eight best reasons why JavaScript developers *love* TypeScript (no exaggeration whatsoever). Check them out!

Building very large applications is now possible

Developers are sometimes required to work dedicatedly on an application – from the prototype development to actual deployment and then maintenance. However, most of the times, this is not the case. Especially when developing large-scale applications. We, for example, have a large team of developers, test engineers and whatnot where each person is handed a different task. They might be codependent, yes, but there is still a large team handling a single project.

It might not be a problem under different circumstances but without proper type information in place, the situation gets messier every time there is a need to replace, rename or refactor a code. Imagine half a dozen people omitting and replacing codes manually (which is quite error-prone, honestly). TypeScript saves the day for the development teams, both literally and figuratively.

The language service knows where there is a need for a renaming and instantly does the replacement work for you; saving you both time and effort of searching, identifying and replacing the bloop. It is extremely beneficial when you are working on an application that is constantly growing in size and scale.

Added features to JavaScript

JavaScript, even as a standalone language, is loaded with features. But as a type-safe superset of JavaScript, TypeScript offers many amazing features on top of the already available ones, not to mention its insane compatibility with the origin language.

Interfaces, abstract classes, algebraic data types, static checking, code refactoring, auto-completion, async functions, decorators, just name them and you have them with TypeScript. Plus, the object-oriented programming, optional static typing disciplines, modern IDE capabilities, million-line applications, and TypeScript are active on any web browser/host or OS; A luxury that was not possible otherwise. When working with interfaces, developers can leave their worries over details aside and simply dive into the world of TypeScript.

    DevOpsCon Whitepaper 2018

    Free: BRAND NEW DevOps Whitepaper 2018

    Learn about Containers,Continuous Delivery, DevOps Culture, Cloud Platforms & Security with articles by experts like Michiel Rook, Christoph Engelbert, Scott Sanders and many more.

Ease of familiarity

Perhaps the most popular reason for the easy adoption of this transpiled language; developers don’t need to learn anything new as it carries same syntax and semantics as other C#, Java, C++ and other structured languages. You can easily build web and native mobile applications with the same languages. It is built especially for the programmers who are used to structured programming.

SEE ALSO: TypeScript — a trend that keeps on trending

Think of it as reheating your last night’s meal. You aren’t cooking anything new, the ingredients are all the same; you are just popping it in the microwave (hello technology!) and waiting for it to heat. It doesn’t matter how your meal was actually prepared. You just need to know how to use a microwave!

Clean, simple code without added complexities

As developers, we all aim towards creating simple, clean code that can be easily executed. But, more often than not, this limits us from stretching our boundaries and creating something out of the box, say JavaScript. We can do millions of things with JS, but we cannot create a million-line application using old JavaScript.

This is what’s different about the new transpiled JavaScript language. Honestly, TypeScript was first built to overcome a bunch of JavaScript limitations; hence all this liberty.

It runs on every browser and JavaScript engine (ECMAScript 3 or above). At the same time, TypeScript gives users the freedom to innovate and express themselves better. A code that describes you and gives you the power to create something awesome.

Auto update is easier than ever

TypeScript brings newer ECMAScript revisions way before it is available on browsers. For example, you can benefit from the updated version before it is officially on the market, even without actually downloading it. Imagine the number of robust components you could build with latest features without waiting for the newer version.

Supports most of the popular editors

Working with a typed platform that doesn’t support editors (at least the popular ones) can be a painful experience for developers. Imagine how helpless we would have been if Google docs didn’t offer editing and instant sharing features. It’s the same for the developers who ‘document’ their codes and need a series of editors to work proficiently. Thankfully, TypeScript supports the MS Visual Studio family, WebStorm, Eclipse, Atom, Sublime Text, Emacs, Vim and more, making our lives easier.

The type system is optional

This is the absolute deal. Type system, when turned on all the time, is a big headache. The running error-detection courtesy type system overwhelms you, giving you little or no breathing space to actually get the bugs squashed. With type system being optional, you get the freedom to define interfaces between software components and handle bugs better.

Incredible speed

In some situations, TypeScript can perform better than JavaScript. This is possible due to the fact that TypeScript eliminates type checks as we proceed, so we can skip checking run-time altogether. Imagine a typed language with exceptional JavaScript (and beyond) features that is fast yet smooth. Sounds awesome to me!

TypeScript in action: Popular examples

As explained earlier, there are a number of frameworks that utilize TypeScript as their typed codebase. However, we have a few extremely popular applications and platforms to add to the list.

1. AngularJS 2: Angular 2’s main codebase is written in TypeScript (thanks Google!). Sure, they didn’t choose the transpiled language just to boost its popularity when they already had their very own dart language. Google especially chose TypeScript because of its ability to create simple and clean JavaScript (ECMAScript 5) code as output.

SEE ALSO: The world of JavaScript: Obstacles, current front runners and what’s next

2. Slack: Slack, a popular enterprise communication tool chose TypeScript to help manage their large JavaScript codebase. With TypeScript being the superset of JavaScript, no coding change was needed.

3. Asana: Asana, a popular publishing and task management platform, went for TypeScript as it allowed them to manage large codebase without any added code complexities. Another reason was that now the application was growing in size which called for constant refactoring– TypeScript’s specialty.

4. Aurelia: Aurelia was particularly impressed by the clean, simple coding structure of the transpiled language. It gave their users the liberty to use TypeScript to build Aurelia applications.

What lies ahead for TypeScript?

Web development is advancing at a lightning speed. New technologies are making debut, earlier ones are seeing revisions over revisions over the period of a few months. TypeScript is only 5 years old, yet it has seen some amazing days (or years). This popularity is nowhere towards the end.

TypeScript 2.8 was released only a couple of weeks ago, offering significant improvements and promising features.

TypeScript is popular, all for good reason. It gives you the strength to create some clean, distinguishable code at a higher speed. It is here to stay- stay at the top of the typed JavaScript list, at least till we get some other programming language with the strength to dethrone it. It is the undisputed leader of typed JavaScript, indeed!

Author
typescript

Tanya Kumari

Tanya Kumari is Content Writer & Marketer for Classic Informatics, an application development agency. She is an avid reader, music lover and a technology enthusiast who likes to be up to date with all the latest advancements happening in the techno world.


Leave a Reply

Be the First to Comment!

avatar
400
  Subscribe  
Notify of