Hacker News new | ask | show | jobs
by shepherdjerred 1373 days 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.

1 comments

Ah 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.
And 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.