4 ms·
> "If I don't typically make a kind of mistake (like setting the wrong variables in a constructor), I don't test for it." Hmm, that sounds like the old "You do
by jiggy2011 14y ago
> "If I don't typically make a kind of mistake (like setting the wrong variables in a constructor), I don't test for it."
Hmm, that sounds like the old "You don't need to test , just be an awesome programmer duh!" argument.
The kind of mistakes you never anticipate making are probably the sort of stuff you should be testing for.
The amount of times I've had something fail on an edge case that turned out to be a typo in a var name on some edge case somewhere..
- jiggy2011 14y agodon't know why this has so many downvotes.
- pekk 14y agoYour tests routinely fail because of typos?
- jiggy2011 14y agoI've seen production code fail because of typos after months in deployment (because that's how long it took that else { branch to be hit in practice). The code in question was only subject to very high level smoke tests that looked like they were basically cherry picked best case scenarios intended to pass. A unit test would have picked this up before it even got to production.
- TeMPOraL 14y agoIn dynamic languages? Sure they may. The PHP script you thought works crashes, the Lisp routine out of the sudden enters the debugger, things like that.
- pekk 14y agoThe question isn't what "may" happen, but what routinely does happen for you. If typos are even a significant problem in your code then the solution is to type more slowly, have your IDE flag unknown symbols, use autocomplete, etc. As a solution to this problem, strong typing is both disproportionate and inadequate.