Ask HN: Is TypeScript worth it?
411–420 of 469 posts
Re: Ask HN: Is TypeScript worth it?
#412Is 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
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?
#413My 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.
Re: Ask HN: Is TypeScript worth it?
#414100% 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
As an example, what parameters does `manim.animation.creation.Create()` accept?
Re: Ask HN: Is TypeScript worth it?
#415Earlier 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?
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?
#416Earlier 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?
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?
#417Re: Ask HN: Is TypeScript worth it?
#418[flagged]
Re: Ask HN: Is TypeScript worth it?
#419[flagged]
Never bet against JavaScript.
Re: Ask HN: Is TypeScript worth it?
#420Earlier 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.
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.