5 ms·
Maybe that's it. That error is fairly obvious to me but I admit in some cases you have to traverse the call stack to figure out where the incorrect value got in
by andybak 9y ago
Maybe that's it. That error is fairly obvious to me but I admit in some cases you have to traverse the call stack to figure out where the incorrect value got introduced.
I still feel I'd prefer the occasional inconvenience in tracking down a bug over some of the pain I've experienced in trying to adapt my brain to a statically typed language. As another poster commented it really only makes sense to compare a cutting edge dynamically-typed language with a cutting edge statically-typed language if you want to debate the strengths and weaknesses of each. Otherwise you're just comparing specific language weaknesses and strengths.
- emodendroket 9y agoI don't know; to me it doesn't seem like much of a cognitive tax to have some guard clauses that can easily be ignored at the beginning of a function and declaring arg types is less annoying than digging through a method trying to figure out what in the world the expected input is. It gives you a way to look at a pretty minimal portion of the code to figure out how to use it and otherwise treat it as a black box, ignoring the implementation details (well, ideally; of course there is some leakage).