Last year I came across this on Twitter:
Increasingly concerned by ppl who believe Java is a code smell and "Use Ruby" is a refactoring Jason Gorman
Right after reading that I started to think, people really believe in that? Yup. The big question is, why?
Probably because they heard someone talking about good code and Ruby. "It has to do with the language. There are so many people talking about how clean is Ruby code. It must be impossible to write bad code in Ruby."
Why are not many people talking about good code written in Java? "That's because the language and its verbosity." Hell no. The Clean Code book was written using Java examples. Nowadays, if you do a simple search in Google like
testing framework + my favorite language you'll see you can write clean code.
The problem is the way people learn Java. Most universities teach Java but I've never seen teaching how to write good code. I learned Java at the university and my professor never said anything about testing or how good code looks like. They give you the basics of Java, assign some tasks and you get a good grade whether your program solves the problem or not. Is this the right way? I agree that it has to solve the problem but it also has to be clean. Professors should create this culture of writing good code, so when the students hit the market they will shine among others that write crap. And better yet, their software won't be buggy. Next time you try to maintain their code you won't go crazy.
What about those that didn't go to the university? People that learn programming by themselves or students that want to learn more than what their professors taught? In this case, the community should guide them.
The Ruby community is passionate about testing. It emphasizes the importance of tests. Good code has tests and has a lot. This could explain why people hear more about good code and Ruby than Java. The Java community is not emphasizing enough the importance of writing good code.
Every line of code written in Ruby is good and clean? Of course not. The Ruby community isn't perfect and won't be, because communities are made by humans and we are not perfect.
This lack of good code(or abundance of bad code) isn't restricted to the Java community. I'm sure that other communities also suffer the same problem. PHP has its problems of copy and paste programming. Other communities also have its own problems, even Ruby has.
What I wanna suggest is: start today talking to your friends, writing blog posts, discussing in your group about how to write good code in your favorite language. Also learn how good code is written in other languages. Don't let people think that one language is better to write clean code than other. Show them how to do it in Java, PHP, Ruby, whatever. FORTRAN can be written in any language as well as clean code.