2 ms·
> and you can get approximately just as much correctness with pretty low-touch unit & integration tests in most languages You can get about the same amount of
by kccqzy 7y ago
> and you can get approximately just as much correctness with pretty low-touch unit & integration tests in most languages
You can get about the same amount of correctness in Haskell or Rust as you can in typical languages by omitting all unit tests.
This is where people saw a certain sliver of Haskell or Rust community pursuing increased correctness with diminishing marginal return and assume they must represent all of the Haskell or Rust community. But didn't the same communities advertise their languages by that magical feeling of "if it compiles then it probably works"? Plenty of people use only simple language features, write no unit tests, and achieve a similar level of correctness as software in other languages with unit tests. But they aren't as visible because efficient boring software engineering doesn't get blog posts.
Besides that, I actually totally agree with your first paragraph. Not all software needs to be totally correct. But my argument is that if you know you don't need total correctness, it will be less work to achieve a certain level of correctness in Haskell or Rust than in typical languages.
- atoav 7y agoThe “if it compiles it probably works”-tagline is certainly truthful in my experience, even without unit tests. I can imagine scenarios where you use Rust in a “non-rustic” way where this might not be true, but this goes against the grain of the language and is usually not very enjoyable to do. These correctness guarantees and tests have the nice side effect of helping you to isolate problems and writing bigger projects in Rust is for that reason alone more comfortable than say in python.
- senderista 7y agoIn my admittedly limited experience with Rust, writing tricky data structure library code, “if it compiles it works” was ludicrously far from true. That’s not to say that the type system didn’t help immensely with correctness, but what helped the most by far was property-based testing, which works just as well in dynamically-typed languages.
- atoav 7y agoIf you worked on a low level data structure library I’d assume your experience is quite normal, as you are not really using the type system as much — this however changes a lot if you program on a higher level. I use python for years now and I am convinced my python code has more errors than my Rust code, just because certain errors that Rust wouldn’t even compile are non-trivial to detect.
- coolsunglasses 7y ago>The “if it compiles it probably works”-tagline is certainly truthful in my experience, even without unit tests. I can imagine scenarios where you use Rust in a “non-rustic” way where this might not be true, but this goes against the grain of the language and is usually not very enjoyable to do. Same situation in Haskell with same provisos. It's very profitable for my coworkers and I to use Haskell or Rust even if it's a slapdash prototype. Saves time now and time later.