Earlier quoted context omitted.
Looking through the Python standard library or Go standard library should be a clue not to use Java idioms, but yes I realize those habits are hard to break. I have seen Java-in-Python and it is indeed painful.
The problem with reading framework and library code is that it's very coupled to what it is, so while it's interesting and valuable to read it's not really the type of code you'd see in a business app or whatever.
On the Impact of Programming Languages on Code Quality
51–60 of 138 posts
Re: On the Impact of Programming Languages on Code Quality
#52Seems 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…
Like Smalltalk, they're forced to do this to catch the errors that would've been caught by type annotation. So then, could the argument be made that less stringent type annotation hurts code quality by removing effort from unit testing?
Re: On the Impact of Programming Languages on Code Quality
#53Seems 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…
That would be interesting. I also have a feeling it would be incredibly difficult to accurately control for social differences in language communities.
Re: On the Impact of Programming Languages on Code Quality
#54Earlier 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
and yet here we are in 2019 where linus happily contributes to a C++ codebase ( https://github.com/Subsurface-divelog/subsurface )
Re: On the Impact of Programming Languages on Code Quality
#55One of the simplest but more important conclusions that affects me all the time... it’s easy to search for things, but hard to know whether you’ve got all the answers you want and hard to know if all the answers you got are answers you want. 6.3 Grep considered harmful Simple analysis techniques may be too blunt to provide useful answers. This problem was compounded by the fact that the search for keywords did not lo…
Smalltalk was wonderful in this regard. If you wanted to search for how something was used, you just right-click search for "senders." If you wanted to find implementors, the same.
This big difference occurred with chains of senders. In other languages, where there's 2 or 3 ways to get to something or call something, you have this O(2^n) or O(2.5^n) blowup in the work you have to do to properly follow chains of senders. With Smalltalk, it's just O(n).
On top of that, there were tools that could let you compose really sophisticated SQL like queries of the code base, dynamically, then pop that up in a browser.
Re: On the Impact of Programming Languages on Code Quality
#56I’ve read a lot of code as a consultant. The best codebase I’ve read had almost no comments and was written in erlang. Besides that every codebase I’ve read in Golang were super clear and of excellent quality for the exception of one that was written by java developers. I can say I hated reading C because of maccros and different build systems. I hated C++ codebases because people abused generics. And I hated Java th…
Fair, but a lot of those abstractions make life more difficult for new programmers (Why do I have to look through 12 classes to find out what this button does?), but make life much easier when you know the code base and have to maintain and extend it.
Or, legit question - is Java more prone to these types of issues due to its design?
Re: On the Impact of Programming Languages on Code Quality
#57Seems 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…
Ruby's community has an obsessive culture towards unit testing, that could impact bug levels. Like Smalltalk, they're forced to do this to catch the errors that would've been caught by type annotation. So then, could the argument be made that less stringent type annotation hurts code quality by removing effort from unit testing?
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.
Type systems are a completely different factor; you'd have to control for that variable too to determine the impact of it. My experience with both systems makes me predict that static typing would improve code quality, but if you want to actually be scientific you'd want to add that factor to the statistical analysis to see if the data support that hypothesis. Anecdotes like personal experience don't count.
Re: On the Impact of Programming Languages on Code Quality
#58Seems 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…
JS also has more ways to shoot yourself in the foot than any other language I've worked with.
Re: On the Impact of Programming Languages on Code Quality
#59Earlier quoted context omitted.
Ruby's community has an obsessive culture towards unit testing, that could impact bug levels. Like Smalltalk, they're forced to do this to catch the errors that would've been caught by type annotation. So then, could the argument be made that less stringent type annotation hurts code quality by removing effort from unit testing?
> 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.…
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.
Re: On the Impact of Programming Languages on Code Quality
#60Is the code quality better? Well maybe. Probably. But dollar for dollar you’ll do better with a good language because you’ll get much better people for your dollar.