re: I’m a Fan of TypeScript, but Please Be Careful! VIEW POST

FULL DISCUSSION
 

I prefer straight JS... while I do often appreciate the extra context that TS provides in my editor, I don't like the extra time it takes to actually write code. I tend to separate my concerns (modules) fairly well and consistently and rarely gain more than I lose in terms of time due to the types of bugs the TS helps to prevent.

 

I think there are more benefits to it than just preventing bugs.

  • TypeScript helped our team to understand each others intentions better since the code you write instantly reveals what types or data structures are expected, for example function parameters.
  • The developer experience with the VSCode intellisense and autocomplete for object properties and methods saves a lot of time.
  • When you refactor code and change data structures, TypeScript will instantly reveal all files and rows affected by the change. For example, it will warn you about you trying to access removed methods or properties. In the end, this won't save you all the time if you don't have automated tests, but it definitely reduces the amount of bugs that could occur caused by simple unintended mistakes. In the end, this can sometimes make up for the extra time that you're mentioning.

With that said I don't think it's a magic bullet, but I think it mainly improves developer experience and often reduces the amount of bugs caused by simple unintended mistakes 🙂 .

code of conduct - report abuse