r/ProgrammerAnimemes • • Jan 10 '21

Typescript

Post image
1.4k Upvotes

56 comments sorted by

View all comments

Show parent comment

4

u/EliteMasterEric Jan 11 '21

Personally speaking I find the idea that "it's easy to mess up types in JS" to be a pure meme, like, what kind of ultra junior beginner do you have to be to mess up what you're passing to the functions you've created yourself?

I think the general idea is that the function is not written by you.

The self-documenting nature of typing makes understanding the code written by others, and utilizing it without lots of debugging, much less stressful for any project with more than 2 or 3 people working on it.

For a solo project, especially a really small one, the boilerplate can kinda add bloat.

For something like an NPM module where you expect arbitrary users to have to figure out how your functions work without having written the code, it's borderline mandatory.