> Whenever a new push event is detected, the lines that are changed in each of the commits in the push event are collected and stored
I think it's important to realize that some languages tend to have more lines of code to achieve the same things as in other languages, and AFAICT this doesn't take that into account. I don't think lines of diff is a reliable metric for "Language Popularity"...
For example, the #2 and #3 languages (Java and C# respectively) have some ceremonial lines of getters and setters. Consider the problem "find the area of a square". In Java or C#, one would often write a class like this:
public class Square {
double side;
Square(double s) {
side = s;
}
void setSide(double s) {
side = s;
}
double getSide() {
return side;
}
double getArea() {
return side * side;
}
}
OTOH, someone writing bash (language #19 in terms of popularity is "Shell") might write something like this:
Yep, OP is comparing apples to oranges, and there's several strange things with the example code, but a direct translation of the original Java code provided into C# is:
public class Square {
public double Side { get; private set; }
public Square(double s) {
Side = s;
}
public double Area {
get { return Side * Side; }
}
}
TLDR: C# doesn't actually need those ceremonial getters/setters that Java still uses, but there was no real need for that to be a public property anyway, although I have kept it that way to match the original.
Ceremonial getters/setters weren't my point, they were just a common theme I've seen in a lot of OO code that I used to help show my point, which was that some languages tend to have more boilerplate than others (and thus, lines of diff is not a good metric for "Programming Language Popularity").
This was definitely an apples to oranges comparison, and I specifically said I was comparing code from different languages - it's a bit tough to do so without comparing apples to oranges, especially when you're comparing "Shell" to "Java". In fact, my whole point boils down to the fact that IMO, the original post was making an apples to oranges comparison - it was comparing lines of diff from various different languages, some of which require more boilerplate than others, and then declaring that it was providing stats on "Programming Language Popularity".
Obviously it would be possible to write very succinct one-liners for Java, C#, or "Shell" (not to mention the fact that the whole goal was the square a number; no functions or classes were really needed), but I still tried to write code in the style that I am used to seeing. You're right, my code wasn't using C#-specific abilities like auto-implemented properties, and I did try to make it look slightly more Java-like.
You are right, C# hasn't required the same ceremony since C# 3.0, but there still are quite a few people who seem to be oblivious to that (in my experience at least). Furthermore, I still count 2 instances of "get" in your code and an instance of "set" as well, so while your getters/setters may not take as many lines as the ones I wrote, you still had to explicitly declare them, which to me is still a bit ceremonial, but I can see how to someone who does it all the time, it may seem like nothing :)
The confusion in your example was using OOP vs functional. The Area getter in my example could be a method, it just makes it slightly nicer to have it as a getter in C# for that type of thing.
But, the actual getter/setter is:
public Size { get; set; }
In Ruby it would be:
attr_accessor :size
In scala it would be:
var size
A little more code in c# but still a fairly concise 1 liner. Which you can't say the same for in Java, unless you use Lombok of course.
But yes, overall I agree, LOC is a bad metric but we don't have much else to go on. Pure project count perhaps is a more reliable metric of language use but still has many flaws.
The graph doesn't load for me so feel free to ignore me if this is not relevant, but regarding this part:
> Results from Stack Overflow are based on the number of times that a tag for a certain language is applied, together with the applied count of the synonyms of that language.
I would suggest that mere count of tag appearance in questions doesn't give you "Programming Language Quality", it gives you "Languages which people ask questions about a lot".
The Stack Overflow datasets include question view counts, I think a combination of tag appearance in questions alongside view counts would be a better metric for "most popular" especially since the number of people _viewing_ posts are a lot higher than the number of people asking questions so you'll get a bigger chunk of the sample.
While it's true that a language which has genuine interest and activity will be represented on the list, languages which require much boilerplate, or which are confusing, will skew upward in the list.
I wonder why Delphi was more "popular" than Go-lang?
I wish Borland Pascal had been more popular in the 90s. It's interesting to think how Java would have fared if there was another viable alternative to the clearly inadequate C++ language. Of course, Borland would have had to NOT try to compete with MS Office, and have been content to be like JetBrains is now - provide a best in class IDE for open source languages, assuming they open sourced the Pascal/Delphi command line compiler.
23 comments
[ 5.9 ms ] story [ 1027 ms ] thread[0] http://langpop.corger.nl/formatted_data
And considering how long it took to load for me, the chart might work, but take forever.
It looks like this, for those who are curious: http://i.imgur.com/O576J4N.png
I think it's important to realize that some languages tend to have more lines of code to achieve the same things as in other languages, and AFAICT this doesn't take that into account. I don't think lines of diff is a reliable metric for "Language Popularity"...
For example, the #2 and #3 languages (Java and C# respectively) have some ceremonial lines of getters and setters. Consider the problem "find the area of a square". In Java or C#, one would often write a class like this:
OTOH, someone writing bash (language #19 in terms of popularity is "Shell") might write something like this:A more idiomatic version would be:
That said: One often finds code with lots of unnecessary boiler plate code and Java's syntax up to Java 8 could not be described as succinct.This was definitely an apples to oranges comparison, and I specifically said I was comparing code from different languages - it's a bit tough to do so without comparing apples to oranges, especially when you're comparing "Shell" to "Java". In fact, my whole point boils down to the fact that IMO, the original post was making an apples to oranges comparison - it was comparing lines of diff from various different languages, some of which require more boilerplate than others, and then declaring that it was providing stats on "Programming Language Popularity".
Obviously it would be possible to write very succinct one-liners for Java, C#, or "Shell" (not to mention the fact that the whole goal was the square a number; no functions or classes were really needed), but I still tried to write code in the style that I am used to seeing. You're right, my code wasn't using C#-specific abilities like auto-implemented properties, and I did try to make it look slightly more Java-like.
You are right, C# hasn't required the same ceremony since C# 3.0, but there still are quite a few people who seem to be oblivious to that (in my experience at least). Furthermore, I still count 2 instances of "get" in your code and an instance of "set" as well, so while your getters/setters may not take as many lines as the ones I wrote, you still had to explicitly declare them, which to me is still a bit ceremonial, but I can see how to someone who does it all the time, it may seem like nothing :)
But, the actual getter/setter is:
In Ruby it would be: In scala it would be: A little more code in c# but still a fairly concise 1 liner. Which you can't say the same for in Java, unless you use Lombok of course.But yes, overall I agree, LOC is a bad metric but we don't have much else to go on. Pure project count perhaps is a more reliable metric of language use but still has many flaws.
"Just in case"
> Results from Stack Overflow are based on the number of times that a tag for a certain language is applied, together with the applied count of the synonyms of that language.
I would suggest that mere count of tag appearance in questions doesn't give you "Programming Language Quality", it gives you "Languages which people ask questions about a lot".
The Stack Overflow datasets include question view counts, I think a combination of tag appearance in questions alongside view counts would be a better metric for "most popular" especially since the number of people _viewing_ posts are a lot higher than the number of people asking questions so you'll get a bigger chunk of the sample.
While it's true that a language which has genuine interest and activity will be represented on the list, languages which require much boilerplate, or which are confusing, will skew upward in the list.
Data is tough.
https://news.ycombinator.com/item?id=8558740
(The actual PDF link won't load at the moment)
E.g. - I'm pretty sure the study above attributed errors in V8 to "Javascript", even though V8 is the interpreter written in C++ or C.
Still, if you throw an appropriate uncertainty range on the results, it's much better than no information about where the action is.
I wish Borland Pascal had been more popular in the 90s. It's interesting to think how Java would have fared if there was another viable alternative to the clearly inadequate C++ language. Of course, Borland would have had to NOT try to compete with MS Office, and have been content to be like JetBrains is now - provide a best in class IDE for open source languages, assuming they open sourced the Pascal/Delphi command line compiler.