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?
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:
interfaceMessage{id:string;msg:string;name?:string;avatar?:string;}typeTBlogMap=(content:Message,index:number,list:Message[])=>Message;// JS is fine but TS dosent know the ...rest part - which is obviously: {id, msg}exportconstblogSameUserHeaderMap:TBlogMap=({name,avatar,...rest},index,postList)=>postList?.[index-1]?.name===name?{...rest}:{name,avatar,...rest};// working versionexportconstblogSameUserHeaderMap:TBlogMap=(content,index,postList)=>postList?.[index-1]?.name===content?.name?({msg:content.msg,id:content.id}):content;
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.
Hi everyone, my name is Jesus Guerrero. I am a Full-Stack developer from the Dominican Republic. I love to learn new things, share knowledge and create things..
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.
Consultant, Full Stack Dev, Game addict. Tech Lead @ MOBIKO. Loving Nodejs, Typescript and Vue. Interested in Clean Code, agile methods and Software Engineering
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π
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.
Mechanic by trade, software dev because it's fun as heck. And, well, it will be nice to WFH when I decide my body has had enough. No commute, A/C, less silica glistening in the early morning air!
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 π
Top comments (11)
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:
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.
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π
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.
Why would you not start with TS? Just copy paste a tsconfig into your JS project and tada now its a TS project
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 π)
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 π
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.
I personally don't see the benefits at all - personal project or otherwise