4

TypeScript types are fun. Problem is: the check is compile-time only.

I just wasted an hour not understanding that an integer passed from command line was actually getting transmitted as a string. The library, where that value landed as parameter, happily ignored the non-matching type and worked as if the value has not been set at all!

Dear library maintainer, please enforce your parameter types! Throw an error right into my face saying I shall not pass anything but an integer! Don't just continue to work to produce false output correctly. Thank you!

Dear TypeScript, I really want type checks on runtime.

Dear JavaScript: Why did you ever think loose types were a good idea? (And I say that as a PHP developer as well.)

Comments
  • 0
    I support the dynamic typing. If you can't keep track of your types, stick to compiled, statically typed languages. JavaScript is a web language, it's meant to be forgiving and to fall gracefully. Crashing on errors doesn't exist in HTML, CSS, or JS for that reason.
  • 1
    give C a run and come back crying to js, if you think that static typing is easier to handle
Add Comment