Comment

Comment by hn_throwaway_99

I'll add a 4th thing to his list based on my experience moving from Java to Typescript:

Nominally-based type systems like Java (where you can only write Foo f = new Bar() if Bar has Foo somewhere up it's static type chain or interface hierarchy) are way more of a pain in the ass than structurally-based type systems like TypeScript (where you can say f: Foo = new Bar() as long as TypeScript determines Bar has all the required fields of Foo).

Primarily this makes refactoring much easier because you don't have to necessarily change things up a (potentially brittle) type hierarchy. Instead, you can just add new properties to your type to fulfill the set of properties required on the target type.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton