Hacker News new | ask | show | jobs
by brundolf 2099 days ago
One advantage of using a very open-ended type system like TypeScript's is that you don't have to know as much up-front.

I could declare some type Foo, and that type might end up being:

- A class

- A record type

- A union type

- An intersection type

- A constant

or whatever else. But I can go ahead and start referring to that type in terms of function signatures, etc. Particularly for this kind of sketch-coding, it's really nice to be able to declare a concept and start talking about it before you even know what it is.