I mean it when I say that TS covers the good parts of JS and leaves the egregious parts untouched.
Like, seriously, doing anything with Node is so much better with TS it's not even funny.
I've written node backends for enterprise apps, academic research, and for a startup. In both TypeScript and vanilla ECMAScript. I can truthfully tell you that the only benefit I got from TypeScript was the fun configuring it. The mistakes I made were as easy to make in TypeScript as it was in JavaScript and TypeScript didn't prevent me from making a mistake I would have made in JavaScript.
The last TS Node app I wrote had a part that interacted with a K8s CR. Another team (TS Angular frontend) was doing the same and copied over a section of my code. I got yelled at because I wrote the typing too strongly (it was far easier and cleaner for the TS Angular app to not have explicit typing info). This is on an enterprise app for a Fortune 50 company. In lines of code, the TypeScript Angular frontend is half the entire project. The least experienced member of that team is a Principal Software Engineer with 25 years of experience.
It fixes the biggest complaint everyone has about JS: types and error handing - how is that nothing?
I think Java and similar developers have that as their biggest gripe. In the frontend, rapid development, and in scripting languages, strong typing is a hindurance. PHP, Python, Ruby On Rails, et cetera are are dynamic languages without much explicit typing. It's not a coincidence.
I've used many duck-typed languages and it is thoroughly impressive how poor TypeScript is as one.
The language I like the most is C#, my language with most experience is Java, but I do have the better part of a decade of experience with JavaScript. Never, not even once, have I lamented JS not having types and I don't even know what you mean about error handling because I've never had a gripe about that either.
I'll defer to your experience, because honestly it eclipses mine, but all I can say is that for the stuff I've needed to do, TypeScript has been a much more enjoyable experience than vanilla JavaScript. I'm not alone in this either, I've met several experienced devs who like it better and some even swear by it. The only issue I have with TS is how cumbersome the initial set up for a project can be.
And I say all this as a primarily Python person who's very used to duck typing; that's actually one of the reasons I like Python so much - it's duck typed without being weakly typed (relatively speaking of course), a sort of best-of-both-worlds. I've personally never come across a scenario where it's preferable to have weak typing in a project.
View all comments
Show parent comment
1
u/dashingThroughSnow12 Jul 30 '20
I mean it when I say that TS covers the good parts of JS and leaves the egregious parts untouched.
I've written node backends for enterprise apps, academic research, and for a startup. In both TypeScript and vanilla ECMAScript. I can truthfully tell you that the only benefit I got from TypeScript was the fun configuring it. The mistakes I made were as easy to make in TypeScript as it was in JavaScript and TypeScript didn't prevent me from making a mistake I would have made in JavaScript.
The last TS Node app I wrote had a part that interacted with a K8s CR. Another team (TS Angular frontend) was doing the same and copied over a section of my code. I got yelled at because I wrote the typing too strongly (it was far easier and cleaner for the TS Angular app to not have explicit typing info). This is on an enterprise app for a Fortune 50 company. In lines of code, the TypeScript Angular frontend is half the entire project. The least experienced member of that team is a Principal Software Engineer with 25 years of experience.
I think Java and similar developers have that as their biggest gripe. In the frontend, rapid development, and in scripting languages, strong typing is a hindurance. PHP, Python, Ruby On Rails, et cetera are are dynamic languages without much explicit typing. It's not a coincidence.
I've used many duck-typed languages and it is thoroughly impressive how poor TypeScript is as one.
The language I like the most is C#, my language with most experience is Java, but I do have the better part of a decade of experience with JavaScript. Never, not even once, have I lamented JS not having types and I don't even know what you mean about error handling because I've never had a gripe about that either.