Skip to content

Comment on Ask HN: Is it worth it to invest in learning TypeScript?parent

Comments

Seconded. But with an asterisk - I've found, as I've learned more and written more TypeScript, that I write significantly less object-oriented code overall. I use a lot more interfaces and a lot more types, and I use runtypes to describe domain objects (to combine runtime validation and static typing).

Classes are still useful, of course, as encapsulations of state, but I don't remember the last time I wrote something polymorphic in TypeScript that didn't feel faintly wrong. Coming from a Java/C# background, the "easy path" in TypeScript feels to me like it nudges you more towards compositional architecture (which is a good thing!).

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.