It's very easy to see the benefits of using TypeScript in projects with multiple programmers. Is it still worth it if you're the only one that will ever touch that project?
![Cover image for Do you use TypeScript with projects only you will touch?](https://media.dev.to/cdn-cgi/image/width=1000,height=420,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbnva2on4pkqtg4pgr20i.png)
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (11)
Of course. If you come back to a project in a couple of months, you will be very pleased you wrote some types and interfaces around your classes/functions. You probably come back for a quick refactor, tada!, this is now super trivial and you are probably done much faster and can go out for a drink with your friends instead of starting up the debugger.
For my TS is not my default option because most of the projects I start is for solving a problem I currently have and I need to advance fast. But if is a short project like a library that I am starting with TS to build the habit and not getting bored.
I'm on early phase of typescript use. I wittingly change my default - hobby - languages from JS to TS. That process sometimes faces some difficulty, on the contrary definitions part is really help, even middle sized project.
But sometimes I found TS is don't really understund every JS declaration.
For example:
Why would you not start with TS? Just copy paste a tsconfig into your JS project and tada now its a TS project
JSdoc with minimal typescript to utilized the typehint and lint for personal project since i work with other language as well and it makes more sense to me. eg: ruby YARD, python docstring, dart doc comments, javadoc.
Sure, typing is kind of a documentation and a safety net at the same time. Usually the projects who were not "worth the effort" to be initialized with it, are the ones that are timewasters anyway - especially if you have plenty of boilerplates available to make the setup super fast🙂
Sure, the code could have less errors and you could read it in the future and still understand your code (before smile and rewrite it 😉)
No chance I'd use TypeScript on smaller things, can't be bothered to type all the extra bloat if only I or a few people will work on it.
Trying to. I like maintaining good habits, as they are hard to form in the first place. I am liable to use my indicators when I'm the only one on the road too, though, so I'm just weird 😁
I personally don't see the benefits at all - personal project or otherwise
Always, unless it's literally a 10 line scratch file to test something.
I find that on anything I work on that is non-trivial, it's much easier to take the time to get the TS right on object types and function inputs and output, and then use the type system later when I consume those same types. It means less mental overhead for me, and ultimately I move faster as a result.
I see a lot of people taking issue with the need to write out interfaces and types. I find that using the type inference system and utility types that TS provides gets me around about 80% of that, so in the end I'm really only specifying types for function inputs and that's about it. Output types are inferred, so if I make a breaking change in a function the TS compiler yells at me where I use it, and I know to fix the issue or fix it where it's implemented.