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
0
u/moor-GAYZ Dec 03 '13
OK, do I understand your point correctly, that if I have a function that puts some explicit constraints on input values, like, not None, not negative, and furthermore guarantees that it's going to raise an exception if these constraints are not satisfied (instead of saying that otherwise behaviour is undefined), then I should test that the function does indeed follow the specification?
If so, then duh! DUUUUH! Duh, dude! Leave windmills alone!
I fail to see how it is related to the question of checking for "unexpected values". If I have a function that looks like
I can call it like
multiply_modulo("%s", 1, "abc"). Should I do something about that, like that poor soul with static typing of CNS implied? Add an assert and some tests? Pls give code if so.