Hacker News new | ask | show | jobs
by throwitaway1123 671 days ago
> JavaScript is so powerful and amazing, it’s a bummer to hamstring your app by using TypeScript and classic OO inheritance models that preclude the beauty and dynamics of JavaScript as a functional, prototypal language.

The idea that Microsoft was attempting to turn JS into an object oriented C# clone was a very common objection in the early days of TS (especially since one of the lead developers on the project is also the primary architect of C#). That objection ended up being completely false. TS aims to type check the full gamut of existing JS, and embraces all of the language's quirks and idioms. There are people doing serious functional programming in TS with libraries like fp-ts and effect (which is basically the TS version of Scala's Zio). If this is your primary objection I would give TS a second look.

1 comments

The problem i see is basicLly, youre doing forced TDD, and thats a inherent cost in quickly developing and deploying apps at the small scale where JS excels.

Ita clearly great for large orgs and interchangeable devs.

I actually use TS as a way to avoid bothering with TDD. Many of the proponents of TDD are using dynamically typed languages, and need tests to verify every tiny little assertion about their code. I remember Eric Elliot had a bunch of posts on Medium years ago denouncing TS and claiming that TDD (and testing in general) obviates the need for types.

I'll accept that there are some intelligent developers out there that are more productive without static type checking, but I personally don't understand it. If you don't have a tool analyzing your program's types, then your brain becomes the type checker. I personally would much rather focus on higher level problems. I don't even see type checking and code formatting as human level concerns anymore, and would rather have my computer do it for me, but I guess it's just a preference. Do whatever works for you.