Re:Static Typing Where Possible, Dynamic Typing When Needed ...
by rajangdavis on Sunday August 06, 2017 @03:09AM
(#14940152)
I meant "enough" as to ask "do I need to do more than writing a check?".
You do bring up a good point with testing (which I don't always do, but I try to at least do runtime checks).
I follow you on the data model part. I think that's where a test framework is super handy.
Another problem is that your runtime guards are often ad-hoc and can drift from your data model, turning into debt that you need to manually reevaluate and clean up. In my experience, there's nothing quite so permanent as a defensive nil guard that everyone is too timid to remove.
But it's not clear what you mean by "is it enough". I definitely use runtime asserts in dynamically-typed languages like Javascript to try and fail as fast as possible in critical functions.