Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Benefit? When my friendly junior developers add a variable where it isn’t supposed to go the system yells at them.

This is much preferable to me yelling at them, or production getting broken.

Typescript may be a little bit slower if you never make any mistakes ever, and can keep the full state of your program in your mind at a given time. Nobody makes no mistakes.



If you don't require at least 2 approvals from medior/senior developers for your junior's PRs you're doing it wrong.

TypeScript is not a "little bit" slower, I've seen it take over 3 times more time (and frustrations, even for an experienced TS guru) to get simple things done.

TypeScript is a colossal waste of time that many sheep gladly embrace because they feel they're expected to. Nobody dares to ask "but why?" when someone else comes up with the idea of adding TS to a project. They should.

I wish I had the money to setup 2 teams of 5 developers each for 12 months. One team: JS only. The other team: TS only. Give them the exact same project instructions, same sprint length of 2 weeks, and the same expectations per sprint.

Here is my guarantee:

- The JavaScript team will get much more done consistently over the entire duration of the project; - The JavaScript team will have a higher quality of code that is more intuitive to read; - The TypeScript team will be the only ones that regularly fail to make deadlines; - The TypeScript team will have to be reminded time and again that they should focus on UI and UX details.

And at the end of the road the JS team will have a far superior project, simply because they didn't waste time typing all of their code.

I've seen it so many times already. Once you use TS the devs focus on the code and forego the idea of UX, a11y, i18n, progressive web, offline capabilities, etc.

They'll often pair-program and waste hours of time to figure out how the hell they're supposed to properly type that one complicated piece of code.

Meanwhile, the JS team using React will simply use JSDoc, code reviews, propTypes, and defaultProps and be done with it.


I am reading your comments with interest. I do not find myself losing time using Typescript, quite the opposite, typing is in code documentation. And I find it much easier to read than untyped code. You say that TS dev focus more on code, maybe it is because they like to focus more on code that they use TS. I do agree you can waste time searching how to type a complicated piece of code. Meanwhile it is worth typing that piece of code if it is subject to change, or that the usage of it is not easy to understand.


I hear the frustration in your comment, and I wonder if it’s because you might not be using TS correctly.

When used right: TS infers most of your types, TS does not add to the lines of code you need to write to get something done (especially if you’re already using propTypes), and TS multiplies your productivity by reducing time spent debugging and by making refactoring super easy.

If you’re interested, I wrote a book about how to use TS, targeted towards intermediate/experienced JS programmers: https://www.amazon.com/Programming-TypeScript-Making-JavaScr...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: