TypeScript — The honest trailer 📺

Take a seat and enjoy the trailer — https://unsplash.com/photos/yKPj4oi9m74

Cons #1: Don’t use TypeScript “as” or “any”

(myObjectIwillTypeLaterButNotToday as any).undefinedProperty.child
// will throw an error at runtime, but will pass typechecking ...

If you use TypeScript, type everything!

Pros #1: VSCode / Editors integration

  • Renaming
    Basically rename a React Component and all itsoccurrences in 2 key strokes.
  • Live background type checking
VScode will use tsserver to check your code as you type, no need for `tsc -w`
See how many times a function is used and where in a glance ✨

Cons #2 : The “magic security belt”

In bodybuilding, the proteins are to be used in addition to a good training and a proper diet.
It’s the same for TypeScript with tests.

Pros #2: Types generation tools

Excerpt from a typings file generated with apollo-codegen ✨

Cons #3 : Compilation speed over time

Pros #3 : Refactoring made easy

TypeScript allows developers to focus on exposed API rather than having to know all the code by heart.

Cons #4 : Development overhead and syntax complexity

Is it useful for small projects ?

Scaling types need practice

Complex types are still difficult to define

“Hello, is it type you’re looking for?”

Pros #4 : Smart and gentle compiler

You don’t need to migrate all your code to TypeScript in order to use it.

  • noImplicitAny
    every variables must have a explicit type (even any)
  • noImplicitThis
    every this must have a explicit type (even any)
  • alwaysStrict
    Do not be confused, this option will add "use strict" to all files.
  • strictNullChecks
    null and undefined are two distinct values
  • strictFunctionTypes
    every functions must have a explicit type (even any)
  • strictPropertyInitialization
    every property of a class must be initialized


Feel free to follow me for Chapter three:




Helping you to get the most of new web technologies ✍️🎙 | https://noti.st/charlypoly

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

TypeScript — Super-types 💪

JavaScript30 — Day 7

Catching and handling errors in Angular

How to Choose an Automation Framework

Test your application using Cypress, GitHub, and Azure DevOps


Avoiding useless Redux tests

Front End Resource Sharing in Fiverr's Decentralized System

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Charly Poly

Charly Poly

Helping you to get the most of new web technologies ✍️🎙 | https://noti.st/charlypoly

More from Medium

How to deal with inferred TypeScript types and stop using any

Index Signatures in TypeScript

Summary of high-level built-in types in TypeScript


Building Up from JavaScript to TypeScript to C# 10 and .NET 6