4 ms·
> Almost all bugs are logic bugs or inconsistent state bugs (thanks OOP!), almost none are type bugs. Many bugs of these classes can be avoided with a sufficie
by shepherdjerred 4y ago
> Almost all bugs are logic bugs or inconsistent state bugs (thanks OOP!), almost none are type bugs.
Many bugs of these classes can be avoided with a sufficiently expressive type system. There’s a reason that Haskell programmers say if it compiles, it probably works correctly.
- somewhereoutth 4y agoAh but Haskell was built that way from the beginning, and has important invariants (pure functions etc) that make it possible to produce inherently sound programs. Of course none of that will help you make the right inherently sound program.
- Akronymus 4y agoAnd it doesn't stop certain kinds of logic bugs (mixing up adding and subbing for example) but it VASTLY reduces the kinds of bugs you tend to have.