Re:TypeScript Roadmap 2019
by sebazzz on Tuesday January 08, 2019 @10:20AM
(#18856049)
Types are documentation, very useful in large dynamically- typed code bases.
[ Parent
| on HN ]
Type annotations does not replace proper documentation. And with properly named parameters the annotations are not needed.
It's also a convention among JavaScript programmers that each function should not only check the parameters, but also convert them, so you can leave out optional arguments, pass a notated object {foo: "bar"}, or pass a string and have the function convert it to an array so you can write foo(bar) instead of foo([bar]) when calling the function. Or convert an object if it's not of the correct instance. This is more fun then annotating types and having a compiler shout out weird errors at you.