Favorite languages ​​and scary languages. Green pastures and brown fields





The Stack Overflow survey results are a great source of insight into what's going on in the development world. I was scrolling through the 2020 results looking for some ideas on which languages ​​to add to our container builds documentation and noticed something interesting about the types of languages. It seems to me that this is not often found in various discussions about developer preferences.



The polls have the category "The most terrible programming languages" (of The Most Dreaded Programming the Languages) and "Most favorite languages" . Both rankings are based on the same question:



, ? ( , , ).


"Scary language" is one that you are actively working with this year, but do not want to continue to use it. A favorite language is one that you use extensively and want to continue to use. The results are interesting because they reflect the opinions of people who actively use each language. Opinions like “I heard that X is cool” are not counted when people value things that they DO NOT use because they heard that this is a new trend. The converse is also true: people who express aversion to a particular language actually use it widely. They are afraid of the language, not because they have heard about its complexity, but because they have to work with it and experience real pain.



Top 15 scary programming languages:

VBA, Objective-C, Perl, Assembly, C, PHP, Ruby, C ++, Java, R, Haskell, Scala, HTML, Shell, and SQL.



Top 15 favorite programming languages:

Rust, TypeScript, Python, Kotlin, Go, Julia, Dart, C #, Swift, JavaScript, SQL, Shell, HTML, Scala, and Haskell.



There is a pattern in the list. Have you noticed?



The worst code is the one that was written before me



Old code is the worst. If the codebase has been in active development for more than three years, then it is already inconsistent. A simple first layer is superimposed on special cases and performance optimizations, as well as various branches controlled by configuration parameters. Real code evolves to fit its niche, while at the same time it gets harder and harder to understand. The reason is simple, and I first heard this phrase from Joel Spolsky.



, [] , , : , .



«, »


Let's call it Joel's Law. Much follows from this premise. Why do most developers think their legacy code is a mess and want to throw it away and start over? Because writing something new is easier for the brain than the hard work of understanding the existing codebase, at least initially. Why are attempts to rewrite code often doomed to fail? Because many junk artifacts are vital small improvements that accumulate over time. Without a specific refactoring plan, you will end up back where you started.





Scott Adams Understood



It is easy to understand the code you write. You do it and improve it along the way. But it's hard to understand the code just by reading it after the fact. If you go back to your old code, you may find that it is inconsistent. Perhaps you grew up as a developer and would write better today. But chances are that the code is intrinsically complex, and you interpret your pain of understanding this complexity as a code quality problem. Maybe that's why the volume of unreviewed PRs is constantly growing? Reviewing pull requests is a read-only job, and it's hard to do it well when you don't have a working code model in your head.



This is why you are afraid of them.



If the real old code is unfairly considered a mess, then maybe programming languages ​​are being evaluated unfairly? If you're writing new Go code but have to maintain a vast 20-year old C ++ codebase, are you able to rank them fairly? I think this is what the survey actually measures: scary languages ​​are likely to be used in existing brownfield projects. Favorite languages ​​are more often used in new green pasture projects. Let's check it out. one



Comparison of green and brown languages



The TIOBE Index measures "the number of qualified engineers, courses and jobs around the world" for programming languages. There are probably some problems with the methodology, but it is accurate enough for our purposes. We use the July 2016 TIOBE Index , the oldest available on the Wayback Machine, as a proxy to identify languages ​​that have accumulated a lot of code. If the language was popular in 2016, chances are people are supporting the code written in it.



Top 20 programming languages ​​on the TIOBE list as of July 2016: Java, C, C ++, Python, C #, PHP, JavaScript, VB.NET, Perl, assembler, Ruby, Pascal, Swift, Objective-C, MATLAB, R , SQL, COBOL and Groovy. We can use this as our list of languages ​​that are more likely to be used in code support projects. Let's call them brown tongues. Languages ​​that were not in the top 20 in 2016 are more likely to be used in new projects. These are green tongues.





Of the 22 languages ​​on the combined scary / favorite list, 63% are brown



Brown Language: The language you are most likely to use in software support.



Java, C, C ++, C #, Python, PHP, JavaScript, Swift, Perl, Ruby, Assembly, R, Objective-C, SQL




Green language: The language you are more likely to use in a new project.



Go, Rust, TypeScript, Kotlin, Julia, Dart, Scala and Haskell


TIOBE and StackOverflow have different ideas about what a programming language is. To overcome this, we have to normalize the two lists by removing HTML / CSS, shell scripts and VBA. 2



Of course, the simple division into greens and browns misses a lot of nuances, including the size of the fields. I expect there should be more green pastures in Swift than in Objective-C, but the current technique seems to cover everything we need. There are many more brown languages ​​on this list than green ones, but this is quite expected, since relatively few new languages ​​appear every year.



Now we can answer the question: are people really afraid of languages, or are they just afraid of old code? Or to put it another way: If Java and Ruby had appeared today, without a pile of old Rails applications and old enterprise Java applications to support, would they still be feared? Or would they be more likely to appear on your favorites list?



Scary brown tongues





Scary languages ​​83% brown The



top scary languages ​​are almost entirely brown: 83% brown. This is higher than the 68% of brown languages ​​on the full list.



Favorite green languages





My



favorite languages ​​are 54% green. Among my favorite languages, 54% are green. At the same time, in the full list, only 36% of the languages ​​are green. And every green language is somewhere on the favorites list.



Another human flaw is that everyone wants to build and no one wants to do maintenance.



- Kurt Vonnegut


This is not enough to say with certainty that the need to use language in a support project is fearsome. But it is very likely that this is at least one of the reasons. Many of the "favorite" languages ​​are too new or too unpopular to amass many big and dirty projects.



In other words, Rust, Kotlin and other green languages ​​are still on their honeymoon stage. Love for them can be explained by the fact that programmers do not need to deal with 20-year-old code bases.



Eliminate bias







Some newer or historically less popular programming languages ​​may be better than older or more mainstream languages, but our ability to judge them seems rather biased. In particular, if the language is new or has not been used before, then it has a certain angelic image. And the longer a language is used, the more devilish it gets in the eyes of developers. I guess the reason is that no one likes maintaining someone else's code. And also because of Joel's Law: It is very difficult to read in the real world. Creating something new is fun, and new languages ​​are used more often.



The Hype Cycle of Programming Languages



Initially, I started to dig into these ratings to highlight a list of commonly used and at the same time favorite languages ​​- for additional examples in our documentation and for assembly examples . Instead, the idea of ​​the programming language life cycle came up: favorite programming languages ​​are often used, this leads to maintenance of the code, which makes people dislike them, which, in turn, leads to people looking for greener pastures - and trying a new language ... Probably popular frameworks follow the same life cycle.





The Hype Cycle of Programming Languages



I don't have the data at hand, but I vividly remember that Ruby was the most popular language in 2007. Although today it has more competitors, Ruby is better today than it was then. However, now they are afraid of him. I think people now have 14-year-old Rails applications in their hands that need to be maintained. This greatly diminishes the attractiveness of Ruby compared to the days when there were only new projects. So watch out, Rust, Kotlin, Julia and Go: in the end, you too will lose your angel wings. 3






1. . , .



, .



TIOBE, , … Wayback Machine. []



2. HTML/CSS - , TIOBE . - , VBA , . []



3. : Python, C#, Swift, JavaScript SQL . - . , Scala Haskell — ,  — . - ??? []



All Articles