Hacker News new | ask | show | jobs
by burtonator 2479 days ago
Typescript is absolutely amazing. I've been working with it for the last 8 months.

https://getpolarized.io/

and the source is here:

https://github.com/burtonator/polar-bookshelf

I could have NOT made as much progress just by using JS directly. When you have a large code-base and you're trying to make progress as fast as possible refactoring is needed and the strict typing is invaluable.

Honestly, the MAIN issue with TS are issues around webpack + typings for 3rd party and older modules.

I'd say 85% of the code I want to use already has types but when they don't it's frustrating to have to pause and write my own types.

I have 20 years of Java experience. Used it since 1.0 and for the most part have been unhappy with everything else.

I've decided that Node + Typescript is by far the most productive environment for me to switch to. I can code elegant apps with both front and backends and I get strict typing.

Could NOT have made so much progress without TS.

2 comments

I'm writing this as a developer who writes a lot of C# and Typescript: Have you tried C#? Even though I sometimes miss the flexibility of Typescript when writing in it, I love the reliability. Maybe it's no as battle-tested as Java (especially with all the rewrites recently), but feels like it's 99.9% there.
Not GP, but as a developer working with TypeScript and C#, I respectfully disagree regarding the type system. There are many things I like better in C# compared to JavaScript, but I feel overly constrained by the type system of C# way more often, and most notable is the lack of discriminated unions (aka sum types etc). You can say that something has this and that, but not that it is this or that.
I agree, as a mostly C# developer for years, then Typescript (Node, Angular and React) for the last couple of years, when I go back to C# projects, I feel like I'm doing a lot of work for the compiler. And really elegant use of the TS type system doesn't translate well into C# many times, forcing me to write boilerplate.

I've been eyeing F# for more elegant managed code, but that's going to take me a little more up-front investment to get productive.

To be clear, are you using TypeScript for both frontend and backend?

Are you using Angular as your frontend?

Not the parent here, but I use TypeScript with React day to day, as well as with node.

I feel a lot less productive without it and the interaction with React has been perfect in my view for the last couple of months.

With hooks allowing a lot more inference in typing and removing most need for Higher Order Components, there aren’t any places where the typing feels like a big impediment. It’s definitely a lot better than it was, say a year ago.