Hacker News new | ask | show | jobs
by smcleod 1362 days ago
Typescript as a language isn't too bad but the ecosystem is an absolute dumpster fire. NPM is terribly fragmented, costs a fortune in effort to maintain dependencies, security updates etc... Every Typescript/JS project I work on is full of a dangerous amount of third party dependencies - it can be hundreds if not thousands in a single repo - many of them fragile in their own special way. Language packages management is hard - but it seems especially hard with TS/JS.
3 comments

Typescript as a language is better than "isn't too bad", it's great! I love the syntax for unions and how normal things like "if" will narrow types.

But I agree that it's a shame that the JS ecosystem is such a mess. Granted, dealing with it is essentially Typescript's purpose, but I would love for it to be a full fledged language on its own, divorced from JS. How cool would it be if you could write normal backend apps in it and compile them to native code?

I use Deno a bit and pretend, but it's not quite the same.

I agree, I wish there was more incentive for developers (especially on the front end side!) to not install every package under the sun and instead be a little less "fancy" or aim for satisfying the 90% rather than the 100%.
I wished Flow or ReScript would have won.

TypeScript is too C#-ish for my taste.

Well, still better than nothing, I guess.

Make your linter forbid the class keyword, it's all about how you write it. The language allows both OOP and functional styles.
Look at the Typescript repo itself.

Very much not like C#. Frameworks like Angular use it very much like c# though.

Yes, it's an okay-ish language.

Often bette than pure JavaScript, which is also an okay-ish language.

So, I think, overall we're better off

That’s not a Typescript problem, that’s a modern JavaScript stack problem.

let Typescript have it’s win here… I want to hate it because I loath Microsoft so deeply, but it really has changed everything in the web world, I wouldn’t hire a front-end dev who couldn’t work in it now.

You can't blame TS for JavaScript.

It's mashing things better by making lib authors like about their API.

jQuery typing showed what a shitty api it actually was. You had no idea what you'd get back f on a call, one element, an array, what type of element.

It made it impossible to build reliable software and why everyone hates jQuery now.

So many early projects had "magic" APIs to save you a few characters or lines of code, only to become a maintenance nightmares because without the docs (or TRYING to analyze source) you had no idea what it did or how.