Message from JavaScript discussions
November 2017
— If you know C++, you know what those errors mean, but in JS you don't get anything nearly that helpful
Without type checking you are reliant on some function in your code throwing a TypeError itself, which could be deep down in execution, several hundred calls into the stack... hard to debug
— With the asserts, one can find very easily that it is their fault
— With a lib/framework it just helps to reduce bored kids emailing me
— And it's always nice to have a unit test which specifically checks that
— Https://github.com/Floofies/Differentia.js/blob/master/spec/Spec.js#L251
— That checks for typeErrors when they are expected
— I am restricted by TDD and specs, which means I don't write buggy code anymore
— Nowadays I only have time to write something that works the first time
— I like your restrictions and user-friendly asserts
— Right, it's just for user experience really
— Duck-typing can be accidentally awesome though