DEV Community

Discussion on: What Do You Think About Types?

Collapse
 
solkimicreb profile image
Miklos Bertalan • Edited

I think interface description can be achieved with decent naming only. In this regard type info is just an additional word in the name. It is not essential for a nice description but it catches misuse early.

This is something nice, I must admit. I used to have a lot of if blocks to catch runtime type errors of the arguments in my OSS code because not everyone reads the docs. Since TypeScript got so popular I just add a type def file to my projects. If someone wants type safety they can use TypeScript and vanilla JS guys can still refer to the docs.

Thanks for the (repeated) comment and sorry for the mess with Sunday's post. 😄