Re:Programming Language Popularity on GitHub and StackOverflow
by matthewking on Saturday December 17, 2016 @11:25AM
(#13201220)
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.
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.