Live data from Hacker News

On the Impact of Programming Languages on Code Quality

arxiv.org

71–80 of 138 posts

Re: On the Impact of Programming Languages on Code Quality

#71
post #33

Casual observation: adding a framework to any language seems to improve the overall code quality. It adds and teaches structure, patterns and good practices that developers usually follow. I've seen terrible codebases written in vanilla PHP, JavaScript, Python (probably the worst ones). But I've seen very good looking, easy to understand, easy to maintain codebases written in Symfony, React and Django. (React is an i…

I agree. Our framework, libraries, and/or interfaces can and should make a bigger difference than programming language. If you have to use the "weird parts" of a language to get typical work done, you are doing something wrong. And if you are not using the weird parts, then programming languages look and do pretty much the same thing. Braggings such as, "look! My language can do double recursive lambda backflips whil…

I think it really depends on how you use the “weird parts”. Some of those let you write code much more concisely and effectively. Used in the wrong context, it’s a unnecessary distraction. It also depends on if you want to write “typical code” or code that the competition can’t match.

See Paul Graham’s essay on the Blub Paradox [0], which discusses why some languages seem to have “weird parts” from the perspective of someone who knows a less-powerful language.

[0] http://www.paulgraham.com/avg.html

Re: On the Impact of Programming Languages on Code Quality

#72

The problem is that "code quality" isn't just bugs per line of code. Maintainability, extensibility, readability, expressivity all factor into it. Suppose I have to write 100,000 lines in language B to write something doable in 10,000 lines of A. Who cares if the defect rate is twice as high per line of A: I still have five times fewer defects due to ten times fewer LOC's. Another thing to consider is the nature of d…

Very much agree. This type of analysis is hard to quantify but anecdotally I don't know many people who have written Go, Rust or Typescript that would prefer python, ruby, java, javascript or c++ for their daily work after using them.

Re: On the Impact of Programming Languages on Code Quality

#73
post #57

Earlier quoted context omitted.

> they're forced to do this Figuratively speaking. None of the languages they test enforce any unit testing. What I'm suggesting is that since the Ruby community tends to be more obsessive about testing, that might lead to an improvement in code quality when comparing against other similar languages like PHP or JS which are less obsessive about testing. It's something you might have to control for to see the impact.…

Figuratively speaking. None of the languages they test enforce any unit testing. The trivial type-mistake "Unhandled Exceptions" in Smalltalk would leak out more often than was comfortable, if the project didn't have a good means of testing to catch those. I suspect that has something to do with the Ruby community being more obsessive about testing.

> "Unhandled Exceptions" in Smalltalk

?

MessageNotUnderstood

Re: On the Impact of Programming Languages on Code Quality

#74
post #42

Earlier quoted context omitted.

Yes, definitely. This is mostly a non-replication of the original study. I was a little disappointed that they didn't look at defects per line of code, even though that's already a fairly well-studied metric. I think the lesson here is that you can write good or bad code in any language, but choose one that's fit for purpose. Using proper abstractions (including those builtin to languages) probably does more to reduc…

The practice that most reduces the incidence of tests is code review: https://kevin.burke.dev/kevin/the-best-ways-to-find-bugs-in-...

I think you mean "bugs", not tests.

Re: On the Impact of Programming Languages on Code Quality

#75
post #46

Seems like they're just doing associations, and not controlling for a lot of factors. For example, you can come up with some narratives to explain a lot of these findings: * Python, JS, PHP, Java, C++ are all very common first languages; I'd imagine the average experience level for these is dragged down a bit compared to others like Golang, Haskell, or Scala. One of the recent Stack Overflow Developer surveys found G…

Additionally, take a look at Fig. 8, "linus C". Those points scream "your data is bad".

Re: On the Impact of Programming Languages on Code Quality

#76

This is great (to see something I know about on HN). As an undergrad at UMass (where Emery Berger teaches), I remember the exact paper they are talking about, and how it was presented at UMass (this was part of a lunch and learn with the faculty, grad, and undergrad students and the author of the original paper). I remember Emery being quite confused at the methodology in the paper, and he was very confused with one…

I knew Emery at UT Austin; he's a good researcher, but I'd imagine "awkward" is an understatement.

Re: On the Impact of Programming Languages on Code Quality

#77

My own take of this: - This study tries to enhance the original work by better metrics (e.g. confusion with C/C++), using better statistics (e.g. uncertainty). - Automatically evaluating the quality of a code is hard and time-consuming. They had to use peer review of labellisation. - Most of the old claims are not confirmed. - Only 2 languages in this study had both a significant impact (impact coeff) and enough fiab…

"... and there may be other influencing factors." Selection bias? Consider the type of person likely to be attracted to languages like Haskell or Clojure. (Note, didn't read the original study so I don't know the selection criteria. Were code samples in different languages from the same programmers compared, or were there different sets of programmers per language? My comment really only applies to the latter case.)

What is the type of person likely to be attracted to languages like Haskell or Clojure?

Re: On the Impact of Programming Languages on Code Quality

#78

Earlier quoted context omitted.

In an infamous rant, Linus Torvalds also hints at using a language as a filter for programmers[1]: >Quite frankly, even if the choice of C were to do nothing but keep the C++ programmers out, that in itself would be a huge reason to use C [1] http://harmful.cat-v.org/software/c++/linus

Considering the astonishing density of defects in Linux we can treat its author’s advice on software development as anti-advice.

What is the density of defects in Linux? Any published comparisons?

Re: On the Impact of Programming Languages on Code Quality

#79

My own take of this: - This study tries to enhance the original work by better metrics (e.g. confusion with C/C++), using better statistics (e.g. uncertainty). - Automatically evaluating the quality of a code is hard and time-consuming. They had to use peer review of labellisation. - Most of the old claims are not confirmed. - Only 2 languages in this study had both a significant impact (impact coeff) and enough fiab…

They found a statistically significant correlation: not a causal relationship and the correlation was small. Using "significant" without those qualifications presents a misleading picture of the results.

Re: On the Impact of Programming Languages on Code Quality

#80
It looks like the key takeaways are:

Overall language effects do not appear to be a dominant factor in software quality. Manual memory management is error prone. Functional languages appear to produce better results than OO/imperaive ones. Static typing does not appear to play a measurable role. In fact, Clojure and Erlang were in a category of their own, beating out statically typed counterparts.

Post reply on HN