You Might Not Need TypeScript (or Static Types)
Eric Elliott
49067

So you say type annotations create more noise and make everything hard to read. And you introduce PropTypes! Cool! So you think this:

const createEmployee = ({
name = '',
hireDate = Date.now(),
title = 'Worker Drone'
} = {}) => ({
name, hireDate, title
});

is less noisy than this?

createEmployee(name: string, hireDate: Date = Date.now(), title: string = 'Worker Drone') {
// Implementation
}

ZOMG!!!

BTW, do you know how your JS line

const identity = arg => arg;

will look like in TypeScript? Take a closer look:

const identity = arg => arg;

That was unexpected, right?

Type inference rocks? I agree! Guess what — it works in TypeScript! No need for Tern.js or Flow — it’s built-in!

Yeah, man, if you’re going to give any advice to anyone, you’d better know what you’re talking about.