Choosing BetweenTypeScript vs JavaScript: Technology, Popularity

David Herron
ITNEXT
11 min readMay 19, 2019

--

TypeScript is a relative newcomer to the JavaScript field, and is a promising addition to JavaScript programming. The value proposition is adding some rigor, type checking and other compile-time checks, that have been lacking in JavaScript. Checks like these should help us write more robust code, especially in large applications.

This is an excerpt from Quick Start to using Typescript in Node.js applications

This is part of a series — see How to set up Typescript compiler and editing environment with Node.js

The loosey-goosey nature of JavaScript programming is great for fast coding, but in theory it does not work so well for larger applications. In a small application a single programmer can easily review the code to find coding mistakes, but in a huge app developed by a large team manually finding coding mistakes is much harder. A common problem is to define an anonymous object that is used in a set of cooperating functions, then later changing one of the functions without changing the others.

In many languages the compiler plays a role in catching certain classes of coding mistakes. Going by the example just named, in other languages not only will the compiler catch that mistake, the IDE has refactoring capabilities to actively help programmers ensure type changes propagate to all affected code.

As JavaScript is being used for larger and larger applications, more rigor should be A Good Thing.

TypeScript is rapidly gaining popularity. Therefore — Is TypeScript gaining popularity? Is JavaScript losing popularity? Are programmers happy with what TypeScript offers? Are JavaScript developers looking for more rigor in their code?

Theory: Better programs through compile-time checks

Why is TypeScript important? Why not just use JavaScript and get on with things? It has to do with our ability to write large applications in JavaScript.

Originally JavaScript was designed for small simple code snippets on web pages, and to help Java Applets better integrate with web pages. The name, JavaScript, was because of a marketing agreement between NetScape and Sun Microsystems where JavaScript…

--

--

Software Engineer and author (Node.js Web Development and more) passionate about Node.js, climate change, EV’s, and clean energy. https://davidherron.com