Live data from Hacker News

Ask HN: Is TypeScript worth it?

news.ycombinator.com

101–110 of 469 posts

Re: Ask HN: Is TypeScript worth it?

#101
post #50

Yep. I've had the foolish (mis?)fortune of scaling a couple of frontend projects from small to not-so-small starting in JavaScript and then converting to TypeScript. In each one, starting out with vanilla JavaScript was faster (no build!), but at some point our velocity would slow as changes required more testing infrastructure. After switching to TypeScript, we were faster than before. Sure, dealing with TypeScript…

> Sure, dealing with TypeScript can be a hassle, but it is less hassle than dealing with broken software. Can you think of examples where it's prevented broken software? I would prefer to spend more time writing good unit test coverage which in my experience would catch anything that TypeScript would have caught. I have seen it be more useful for autocomplete and self-documenting code, which I could get using JSDoc o…

If your entire codebase uses static typing, you don't even need an entire class of unit tests for checking the validity of inputs/outputs to functions. You can spend that time testing business logic instead.

Re: Ask HN: Is TypeScript worth it?

#102

You couldn’t pay me to work with Vanilla JS on any real life project. It feels like going back to horse and buggy. The biggest things I wouldn’t be able to live without: - the self-documenting nature of Typescript code (I instantly know what a function accepts and returns by hovering over it). - the comprehensive auto complete my ide gets (saves hundreds of trips to the docs / source code per day). - the incredible p…

I haven't worked on a Ts project, but feels like i already get most of the stuff you mentioned, through ts-check in a regular js project.

Re: Ask HN: Is TypeScript worth it?

#103
I've come to TS from Python.

To me, install a new package and it requires "target=ESNext" and modules="ES2022" and suddenly I feel like I'm back in the Python 2 to Python 3 transition debacle.

Except this happens every couple of weeks!

Re: Ask HN: Is TypeScript worth it?

#105

> I want to skip over the static typing benefits argument, because I think it is well understood that static typing is a good thing and if we could bless JavaScript with a built-in and robust typing system then I don't think many people would be against that. My issue is with the amount of extra work it places on developers, much of it the "dumb" kind of work which can eat up hours and doesn't deliver all that much v…

> In other words, you're focusing on the 20% BS out of the 80% benefits. Can the 20% be improved? Of course, but I'll take 80% benefits over 0% with JS any day.

There are other alternatives outside typescript and javascript, especially for serverside development.

Re: Ask HN: Is TypeScript worth it?

#106
I make it about 20 minutes into a JS project before I have to go install TS because I'm losing my mind. It's such a no-brainer that the question barely parses. Javascript is medieval and typescript is... less so.

I know it's not an interesting answer and a lot of other people say the same thing; guess I'm just casting my vote.

Re: Ask HN: Is TypeScript worth it?

#107
post #105

> I want to skip over the static typing benefits argument, because I think it is well understood that static typing is a good thing and if we could bless JavaScript with a built-in and robust typing system then I don't think many people would be against that. My issue is with the amount of extra work it places on developers, much of it the "dumb" kind of work which can eat up hours and doesn't deliver all that much v…

> In other words, you're focusing on the 20% BS out of the 80% benefits. Can the 20% be improved? Of course, but I'll take 80% benefits over 0% with JS any day. There are other alternatives outside typescript and javascript, especially for serverside development.

Serverside, sure, I'll agree with you there (I use Rust for my backends).

Clientside, I've tried a lot of compile-to-JS or WASM languages and frameworks. They're just not there yet, especially when you run into some compatibility problems, not to even mention library support on the frontend. The reason I like TS for frontend is it's just JS at the end of the day, you can strip out all of the types and it works. Therefore, things like compatibility issues are simply...nonexistent.

Re: Ask HN: Is TypeScript worth it?

#108
TS can be a pain. I know, I fight with it all the time. That’s probably my fault though. I’ve learned typescript by being exposed to it in our code base, rather than properly learning it through documentation.

For all the struggle, it makes me feel very confident about the code, and its reliability. That’s worth a lot.

Re: Ask HN: Is TypeScript worth it?

#109
post #106

I make it about 20 minutes into a JS project before I have to go install TS because I'm losing my mind. It's such a no-brainer that the question barely parses. Javascript is medieval and typescript is... less so. I know it's not an interesting answer and a lot of other people say the same thing; guess I'm just casting my vote.

There was a time, once, when I did things with vanilla JavaScript. Not huge, ambitious things, but not trivial things either. Now TypeScript has ruined me. I'm pretty sure it didn't really mean to, but I've become so used to encountering `any` and saying "that needs to not be" and fixing it that now there's a reflex in my head that makes the thought of `any` just uncomfortable. I try to write vanilla and I start sweating, it just feels so unsafe.

Re: Ask HN: Is TypeScript worth it?

#110
post #106

I make it about 20 minutes into a JS project before I have to go install TS because I'm losing my mind. It's such a no-brainer that the question barely parses. Javascript is medieval and typescript is... less so. I know it's not an interesting answer and a lot of other people say the same thing; guess I'm just casting my vote.

[deleted]
Post reply on HN