4 ms·
You can't call something simple, if you can't to determine how it's working at each step. In JS all you can say is just "with that sort of data looks like it wo
by sjapkee 8y ago
You can't call something simple, if you can't to determine how it's working at each step. In JS all you can say is just "with that sort of data looks like it works well, but with others it can throw error or has undefined behavior". With types it works or not works. There is no type issues, only algorithm issues. Of course it's simpler.
- z3t4 8y agoThere are trade-offs, for example if you pass "3" should it also work when passing in "three" !? By limiting possible errors/inputs, you also make it harder to use.
- dunefox 8y agoThat's a semantic error, not a type error.
- sjapkee 8y agoIt's simpler to use when you see interface. Otherwise you should read all function code to find out how it works and what kind of data you can pass into it. Of course you can say, that there is should be comments/documentation, but your code should be the best documentation itself.