Hacker News new | ask | show | jobs
by nescoiquid 2840 days ago
And studies show that the number of lines of code a developer puts out in a day is basically constant across all languages. This is usually cited as an argument for more expressive languages.

But if bug count is proportional to LOC and LOC per day are constant across all languages, then bug per day will also be constant across all languages.

You can write shit code in any language. I used to think Java made it harder to write shit code, but the project I'm on right now has made be reconsider this opinion.

3 comments

If bug count is proportional to LOC and LOC per day are constant across languages, then bugs per day might be the same. But you'd still expect features to be getting implemented at a higher rate, and you'd expect a lower bug count per feature. That's ultimately the metric that's most interesting from a business perspective.

IME, the bugs are also easier to deal with in the more expressive language. They tend to be things like faults in the business logic or gross edge cases that people are likely to catch in code review or QA. Whereas the bugs in languages like Java seem to typically be really annoying things like off-by-one errors, comparing Integers with ==, and goofy run-time type errors that sail past the compiler because of weak static type checking when generics are at play, and also past code review because people aren't expecting to have to review for type errors when they're using a static language.

> But you'd still expect features to be getting implemented at a higher rate

Yes, I'm inclined to agree, but I actually haven't ever seen a study which compares the same project implemented in different languages to establish in toto the variance in SLOC. It could be the case that in the main for the same project the differences between languages wash out, as different languages may have different advantages and disadvantages that are more likely to tell on a substantive project.

What you suggest seems reasonable, but I simply don't know it to actually be the case.

> But if bug count is proportional to LOC and LOC per day are constant across all languages, then bug per day will also be constant across all languages.

Of course -- but the important thing is that bug count per feature/app will be lower in a more expressive language.

Bug count per day is constant...but functionality per line of code is higher with the more expressive language.

Umm...so for the same amount of bugs I can have more features if I choose the more expressive one...