39 points · by type0 · 9y ago · 10 comments
It's possible that the association exists here, but it would be better to see a scatterplot of various metrics (stars/watchers/forks/activity metrics) against "bug density" with languages plotted in different colors. It wouldn't surprise me if the 'no one gives a shit about your toy system' factor is higher than the 'which language you chose' factor.
Give me a static typing system that requires no effort on my part (e.g. is entirely inferred, negligible build time penalties, etc.) and has zero false positives (e.g. every type error reported by it is an actual bug to fix) and you'll have a very hard time convincing me this could be anything but a good thing, even on the most TDD driven of projects. It's basically a free lunch.
The question then, is not if static typing conceptually is a good thing, but which static typing systems (if any) make satisfactory tradeoffs - and thus are more beneficial than not.
With the rise of larger codebases and hard to exhaustively test things like multithreaded, multiprocess, and multinode code, I only find myself moving more and more towards static analysis (including static typing) on top of dynamic approaches (not just TDD, but various assertions, telemetry, logging, fuzzing, chaos monkeys, etc.)
Of course, what you want is all your bugs to be discovered quickly. It'd be interesting to see the bug/year count across all projects for each language, too. I suspect dynamic languages are prone to "coping" with bugs for longer, until a broken edge case is discovered.
I thought the expressiveness of the language might be a factor. A line of Haskell does more than a line of Java, so it there is more room for bugs. Clearly not.
I thought the age of the language might a factor. We would hope that language designers learn from what has gone before, and make better languages. But Erlang, one of the oldest in the sample, is also one of the least bug-prone.
The one that really shocked me is Ruby vs Python. The two are similar in so many ways, and on the points where they differ, I would have expected that Python’s “one way to do it” philosophy would have made it less bug-prone. That’s clearly not how it works.
I don't even know what "bug density" is because the author doesn't define it, but I assume it is some count of bugs divided by lines of code. It doesn't seem like the author tried to normalize or control for any factor, including basic ones like the age of the project.
I'm not sure what a sound approach to answering this question is—I think this is a topic worthy of academic study—but this is definitely a low-quality analysis.