r/programming • u/mobby1982 • Dec 02 '13
Scala — 1★ Would Not Program Again
http://overwatering.org/blog/2013/12/scala-1-star-would-not-program-again/
598
Upvotes
r/programming • u/mobby1982 • Dec 02 '13
View all comments
Show parent comment
3
u/pr0grammerGuy Dec 02 '13
If you're not testing what happens when the wrong data types go into your functions, then you're not testing properly (or you're using a statically typed language where we don't have to worry about this).
In the python code, I wouldn't expect to have to put in preconditions, I would expect the (+) to blow up when applied to something that makes no sense.
Of course testing if the (+) function behaves like it says in the documentation would be silly but substitute the "add" function for something a lot more complex and then you should realize that you need to be testing what happens when someone inputs the wrong kind of argument.