re: TypeScript is a waste of time. Change my mind. VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Right click “refactor > rename” and VSCode does the rest because it’s aware of TypeScript’s instrumentation of the code.

I can do that with regular JavaScript as well though... isn't this an IDE feature as opposed to a TypeScript feature?

Webstorm can’t do this effectively in Javascript. Anyone who has tried that (as I have) will discover that WebStorm gets it wrong because it can only make guesses. However when you provide the IDE with the instrumentation of TypeScripts types then the IDE can be 100% accurate. Yes it’s an IDE feature (which I stated in my original message). So that’s why a failed refactor in JS would necessitate a regression tests of the system.

I think it’s wise to consider the trade-off between the initial development costs and then maintenance costs. That’s why I find comments like this concerning:

However, like the point I made in my article... writing TypeScript is definitively, provably longer than writing normal JavaScript

Yes, I can write it faster in JS. But when I fix one bug and it uncovered another bug... that takes more time in total. Each subsequent bug that’s created takes even more time. However, if you just wrote the app in TypeScript the first place then the subsequent bug fixes can be identified by the compiler. Which means:

  • less manual regression tests need to be run
  • bugs that are caught by the compiler are fixed before they even enter production
  • since you don’t have to fix production bugs you can do so with calmness. Doesn’t everyone want calmness and peace? I’d take that over initial development speed any day.
code of conduct - report abuse