
Ask HN: Is there empirical evidence that static types reduce bugs? - Kinrany
Hillel will shank the owner of that open source library you&#x27;re competing with if you can provide access to relevant internal studies of some tech corp: https:&#x2F;&#x2F;twitter.com&#x2F;hillelogram&#x2F;status&#x2F;1291063196317605889
======
auganov
I think a better way to phrase the question is: "Is there empirical evidence
that static types reduce software defects that make it into production?"

Or alternatively if that's not a concern "Is there evidence that static typing
increases developer velocity by reducing debugging time?"

It's pretty unquestionable that some classes of bugs are eliminated at compile
time. But whether it actually ends up mattering in the big scheme of things is
another question.

I'm guessing the answer to the first question is a qualified yes, while the
answer to the second is no.

------
seanwilson
How could it not? By definition, strong statically typed languages won't let
you release code with certain classes of bugs so they must reduce bugs going
live unless humans are perfect bug detectors.

~~~
Kye
A lot of research goes into testing things that seem obvious. Sometimes it
turns out the obvious answer is wrong. I think this is why Kinrany asked for
empirical evidence.

~~~
seanwilson
What specific part of my argument are you disagreeing with though? You don't
need empirical evidence for what you can derive from definitions. It would be
more complex if the question involved time or cost.

I agree with what you're saying in general and I'd love to see some robust
studies too but you have to accept here that it's prohibitively impractical to
get many multiples of developers/teams to develop the same app over several
months through to the maintenance stage with all other variables isolated.

That's why most studies use inexperienced students or are based on crawling
GitHub repos, then end up being really flawed.

It would probably be challenging to show autocomplete, syntax highlighting and
undo/redo lead to productivity gains as well - nobody has the resources and/or
will to investigate these at a large scale with all other variables isolated.

~~~
s1t5
It's not that there's anything specific to disagree with in your statement.
The point is that when the question is "Is there evidence...?" an answer like
"This is what makes sense to me..." is almost irrelevant.

~~~
Kye
I like the way another comment handled the same concerns:
[https://news.ycombinator.com/item?id=24069315](https://news.ycombinator.com/item?id=24069315)

They offered some different questions, pointed out the issues with the line of
inquiry, then restated the question under the question in a different way:

>> _" It's pretty unquestionable that some classes of bugs are eliminated at
compile time. But whether it actually ends up mattering in the big scheme of
things is another question."_

And that question is worth studying.

