Re:Why Kotlin is my next programming language (2015)
by winstonewert on Monday June 20, 2016 @12:52AM
(#11936117)
I find this to be a rare case. Of course, YMMV. But I don't see or write tests in dynamic languages that verify behavior when I pass an inappropriate type. I trust that it'll produce an error when it tries to use operations that the type doesn't support.
[ Parent
| on HN ]
Re:Why Kotlin is my next programming language (2015)
by sanderjd on Tuesday June 21, 2016 @11:14AM
(#11946240)
Maybe I'm misunderstanding you, but it sounds like you mean that you trust it to produce that error when it's running (ie. in production). If that's the case, couldn't you do the same for all kinds of bugs and not bother writing tests at all? Put another way, what is different from this class of bug, which you don't think is worth testing, and other classes of bugs, which it sounds like you do?
Re:Why Kotlin is my next programming language (2015)
by winstonewert on Tuesday June 21, 2016 @11:59AM
(#11946675)
Primarily specificity.
I want the function to fail when it is passed the wrong arguments, but I don't really care about how exactly it fails. If the wrong types get passed to a function, I'm already screwed and there's no way to do the right thing at that point. I only care that I get enough information to debug what happened.
In pretty much any other case, I want to function return some precise value or do some precise action. These are situations that the code will encounter during normal execution, and so I do care about what exactly it does.