3 ms·
My statement that you're unlikely to experience problems if you write something in a language with so many compile-time checks isn't "true at all"? Really? And
by thirsteh 13y ago
My statement that you're unlikely to experience problems if you write something in a language with so many compile-time checks isn't "true at all"? Really? And if you really want to argue about silly examples, we can talk about Agda instead, a language in which even your contrived example wouldn't need any unit tests.
I never said that you didn't need tests at all, or that you couldn't deliberately write programs that didn't work. I'm just of the opinion that the heightened focus on unit tests is a symptom of a language that doesn't perform such checks for you automatically.
I also very strongly disagree with your insinuation that you need unit tests. Fuzz tests can be much more powerful.
- jrockway 13y agoI've written plenty of production software in statically-typed languages, including Haskell. I write about as many tests for them as I do in other languages. Having also written a lot of Python, I don't find my software dying unexpectedly from AttributeErrors. Instead, it merely produces the wrong answer because the wrong code was in the method. The advantage the compiler brings is the ability to refactor. With tests, you don't know if you've gotten everything. But if you change a method signature in, say, Java; you'll know immediately when you run the compiler. But it doesn't mean your program will produce the right answer, it only means that you're calling the function with the right number of arguments of the right types.
- thirsteh 13y agoYou're disagreeing very passionately with points I never made. I literally said "I don't disagree that tests are essential." I followed that up with the statement that programs written in languages with compilers that perform a lot of checks at compile time tend to work as expected, to which you responded with "not true at all," and gave an extremely contrived example of something that "needs to be tested."