5 ms·
Static typing doesn’t reduce bug density, this is no news, just a risk compensation principle at work. But there’s another factor: static typing creates a nice
by keymone 8y ago
Static typing doesn’t reduce bug density, this is no news, just a risk compensation principle at work.
But there’s another factor: static typing creates a nice puzzle for you to solve instead of solving the actual problem. You solve the puzzle and feel nice, you show the solution to management later and they feel nice to because it’s all neat and hierarchical. Then you write majority of the code that doesn’t neatly fit the puzzle’s constrains, then new feature requests/requirements come in and after a time the puzzle needs to be solved again. And so the wheel turns.
What people usually mean when they talk about static typing is a language to specify promises and requirements. To my knowledge that language has not yet been successfully reduced to mostly static and rigid annotations that are useful in dealing with changes to the software itself.
- hitekker 8y agoI found this true for Flow but not as much for TS
- bcherny 8y agoHow so?
- zbentley 8y agoI've heard that argument before, but I've never seen that sort of behavior in practice. If anything, statically typed (or heavily annotated) codebases I've worked on have been much more amenable to change when it comes to adapting to "code that doesn’t neatly fit the puzzle’s constraints" as you say. The refactoring tooling and assurances provided by the type system tended to make people more willing to start rethinking their "puzzle" (type design) earlier in the process, rather than doubling down on a flawed model. I've seen people do similarly great work in highly dynamic languages, too, so this isn't a "static > dynamic types" statement; just an anecdote in contrary to your claim.
- keymone 8y agoThe puzzle is not some inherent problem within the one you’re actually solving, it only arises because of limitations of any type system you choose to work with.
- zbentley 8y agoI don't think that's true. But even if I did, it doesn't address my point above that, in return for having to solve the "puzzle", programmers in more strongly-typed languages gain numerous other advantages.
- keymone 8y ago> in return for having to solve the "puzzle", programmers in more strongly-typed languages gain numerous other advantages advantages and disadvantages. and solution to the puzzle is almost always wrong or becomes outdated and requires major rethinkings often.