Live data from Hacker News

Ask HN: Is TypeScript worth it?

news.ycombinator.com

411–420 of 469 posts

Re: Ask HN: Is TypeScript worth it?

#412
post #234
post #214

Is it worth it compared to what? Plain JS? Transpilation from a different language? Rust? Growing apples? I have used plain JS, GWT, and TypeScript. TS is an incredible improvement over the two others. The TS type system is excellent, very expressive and helpful. An important advantage you get from static typing is that your IDE has more information to work with and so becomes more powerful. If you code in a text edi…

try out dart, its much better than TS

That's subjective and I'm sure it is for you. I personally prefer TypeScript.

I'm glad to see passionate developers keeping on both sides. That's how we grow and become better.

Re: Ask HN: Is TypeScript worth it?

#413

My use case is a bit odd, but I've been using it for small personal web projects — so small that no dependencies are being pulled in and bare tsc is being used in place of a bundler — and as someone who doesn't have all of the ins/outs and do's/don'ts of JavaScript committed to memory (the vast majority of code I write is Swift or Kotlin) it's wonderful to have something catching errors before I save and reload the b…

Offtopic perhaps, but if most of your code is in Swift or Kotlin, have you tried the new Kotlin frontend support? I don't have any project where I can use Kotlin in the backend right now but I've always wanted to give the Kotlin frontend a go as an alternative to TypeScript.

I haven't, mostly because none of my front end web projects feel large/complex enough to justify the extra overhead (probably wouldn't even be using TypeScript if it were any more involved than running `tsc --watch` in a terminal window). Might look into it for future projects though.

Re: Ask HN: Is TypeScript worth it?

#414
post #164

100% worth it to me. I love typescript. Working on large enterprise applications where one function calls other function and it goes 10+ layers deep I don't know how I would work without typescript. Just being able to see this function takes argument of type FOO and returns type BAR[] is incredibly valuable.

One thing I often tell people is that if a particular technology makes it easier to work with code that's 10 layers deep, it will also make it more likely that people will write code 10 layers deep where they would previously do 5 layers. Somewhat similar to https://en.wikipedia.org/wiki/Jevons_paradox

Not in my experience. People will happily write 10 layers deep if you let them anyway. Technologies like Typescript make it easier for other people to untangle the mess.

As an example, what parameters does `manim.animation.creation.Create()` accept?

Re: Ask HN: Is TypeScript worth it?

#415

Earlier quoted context omitted.

IntelliJ / WebStorm has this exact feature. You can also generate API types based on your backend.

That is cool. Will try that. But the type information the IDE provides to me is sufficient even without TypeScript. So, back again to the question — is TypeScript worth it?

I had the same question initially. TypeScript is the way you configure intellisense. Some types can be inferred, but not all, and most of the typing I do is to _restrict_ what data can be used. TS gives you feedback anywhere you ask for it, and paired with IntelliJ I feel like I have superpowers.

Another point: You can create types for your API client programatically, meaning your front-end can be aware of exactly what types your backend is returning. This cannot be accomplished with intellisense.

Re: Ask HN: Is TypeScript worth it?

#416
post #164

Earlier quoted context omitted.

One thing I often tell people is that if a particular technology makes it easier to work with code that's 10 layers deep, it will also make it more likely that people will write code 10 layers deep where they would previously do 5 layers. Somewhat similar to https://en.wikipedia.org/wiki/Jevons_paradox

Not in my experience. People will happily write 10 layers deep if you let them anyway. Technologies like Typescript make it easier for other people to untangle the mess. As an example, what parameters does `manim.animation.creation.Create()` accept?

Some people make things as deep as they can handle. If you reduce the pain from deep hierarchies, you will inevitably end up with deeper hierarchies.

Also, doesn't your example prove my point?

I'm saying focus on types leads to deeper hierarchies. Your example has types and a deep hierarchy.

Re: Ask HN: Is TypeScript worth it?

#420
post #416

Earlier quoted context omitted.

Not in my experience. People will happily write 10 layers deep if you let them anyway. Technologies like Typescript make it easier for other people to untangle the mess. As an example, what parameters does `manim.animation.creation.Create()` accept?

Some people make things as deep as they can handle. If you reduce the pain from deep hierarchies, you will inevitably end up with deeper hierarchies. Also, doesn't your example prove my point? I'm saying focus on types leads to deeper hierarchies. Your example has types and a deep hierarchy.

> Your example has types and a deep hierarchy.

It was originally written without type hints. It looks like somebody has added them since I last used Manim (a couple of years ago) to make sense of the mess!

In my extensive experience code with static types is always easier to follow than dynamically typed code. There's no contest.

Post reply on HN