3 ms·
> This premise of many bugs being "type errors" is overblown and certainly very recent, for i've never heard such a claim on the internet until only recently (1
by lmm 9y ago
> This premise of many bugs being "type errors" is overblown and certainly very recent, for i've never heard such a claim on the internet until only recently (1 or two years ago).
Not true, I've been seeing it since at least 2004, and making it from not so long after that.
> the world was using dynamic languages for decades on the internet (old ASP, old Actionscript, old JS, PHP4 anyone?)
All of which were notoriously buggy.
> If the 15% of your bugs are simple type errors, then I'd suspect the quality and experience of your development team.
I struggle to think of a bug that isn't a type error. Almost all bugs^ boil down to "the programmer thought this was this, but it was actually that". As you gain experience with using static typing, you see how you can use it to eliminate all your bugs, and the ones that slip through turn out to be cases where you should have made a type distinction but didn't.
^ implementation bugs - I'm not counting cases where the program does what was asked for but that turns out to not be what was wanted
- jbergens 9y agoI think that when you have a type system that catches all bugs the type system itself is probably Turing complete. Writing the types in such a system may very well be programming. The more advanced systems are already too hard to use too be helpful for common business people which means they don't help much in reducing bugs from misunderstanding the specs. Just my $0.02.
- lmm 9y ago> I think that when you have a type system that catches all bugs the type system itself is probably Turing complete. Writing the types in such a system may very well be programming. It is programming (though the best way to do it is in a system that's distinctively not Turing-complete - look at what Idris does), but it's all verified at compile time. > The more advanced systems are already too hard to use too be helpful for common business people which means they don't help much in reducing bugs from misunderstanding the specs Not my experience. The type systems make it much easier to express your actual business logic in straight-through code that looks like what it's meant to do, shunting off the awkward cross-cutting concerns to be resolved ambiently in a way that's safe, but doesn't get in the way right now.