DEV Community

Discussion on: The broken promise of static typing

Collapse
 
ericnormand profile image
Eric Normand

Hi Dan!

Nice analysis.

When you calculate bug density, is it # of bugs divided by # of lines of code?

If so, this is really surprising! I read somewhere that bug density was pretty much a constant. So more concise languages had an advantage by being shorter.

However, your analysis shows that Java and C++ have more bugs per line of code!! So more code * more bugs = more more bugs! Ouch!

It would be cool to see the distributions of these languages. How wide are the curves? Does bug density vary widely in Java projects? What about Haskell?

Rock on!
Eric

Collapse
 
danlebrero profile image
Dan Lebrero

Hi Eric,

I have updated the post to make it clear: "By bug density I mean the average number of issues labelled "bug" per repository in GitHub"

The assumption is "I do expect is that roughly all developers, no matter the language, have to solve the same problems, so the open source libraries available have roughly the same functionality.". David seems to disagree on this assumption. What are you thoughts?

I also remember reading somewhere that bugs are constant per lines of code, but maybe what was constant was the number of lines produced or the number of lines that you can keep in your head. I unable to find the reference right now.

Steven McDonnell in the "Code Complete" book says: "the number of errors increases dramatically as project size increases, with very large projects having up to four times as many errors per line of code as small projects"

Great idea for another pet project. Maybe one for PurelyFunctional.tv? ;)

Thanks a lot!

Dan