Lies, SLOC Lies, and Advocacy Statistics

by chromatic

According to PHP Eats Rails for Breakfast, PHP is more dominant than Python or Ruby because a survey shows that there have been more lines of code written in PHP in the 3000 surveyed projects.

Of course, if a metric as broken as SLOC really suffices for advocacy these days, it will only take a handful of web apps written in assembly, COBOL, and AppleScript to leave PHP far, far behind as the new hotness.


9 Comments

Fred
2006-10-21 21:34:07
I totally agree. Doesn't comparing lines of code in PHP to Rails code ignore the sales pitch of Rails, "Write less boilerplate code, and start writing your application" ?
M. David Peterson
2006-10-22 04:25:29
What drives me *CRAZY* in regards to these types of surveys is the notion that the number of lines of code is representative of both quality and strength of position.


WRONG!


If we're doing our jobs correctly, with each passing year we should be required to write *LESS* code, and therefore total number of lines of code, to get the same job done using *MORE* lines of code with the previous technologies we used.


In addition to this, and in particular to PHP, how many projects have been developed in PHP by first time developers compared to how many projects have been developed in other languages such as Python and Ruby by experienced developers who just so happen to understand that you can write in two lines what might take an inexperienced programmer 100 lines to write in PHP. Add to this the fact that there are always going to be more novice than experienced programmers and what you have is a metric SO FAR SKEWED that its not even a metric that provides ANY sort of benefit to anyone who might be attempting to make a decision based on this metric.


To anybody looking to find a metric that would help them make a decision in regards to what technology to use or who to hire for a job,


"Here is a problem. Using your language of choice, solve it."


Use the technology and/or hire the developer that solves the problem in the least amount of time and the fewest lines of code.

Jeremy Jones
2006-10-23 06:02:50
I looked at this post and their conclusions seem like wishful thinking. The three things they were looking at were lines of code, active developers, and new projects. SLOC is dramatically up for PHP, but relatively flat for Python, Perl, and Ruby. Active developers are declining for Perl and Python, slightly rising for Ruby, and up and down for PHP. New projects are dramatically increasing for Ruby, declining for Perl, and moderately increasing for Python and Ruby for the past 2 years. What does this tell us? Maybe, just maybe, the numbers for Ruby specifically really reflect the current web startup philosophy: do a lot (many projects) with few resources (low number of active developers) and do it quickly (in few lines of code). I really don't get how churning out reams of code is a great statistic to flaunt. And I don't see how the combined numbers for PHP paint a great picture. But then again, the numbers don't appear to paint a great picture for Python or Perl, either.
Adam Kennedy
2006-10-24 09:35:28
This numbers are hideous.


Firstly, they populate from the "forges" and only add from version control. So forget about CPAN and 80% of Perl code, since it's already been established previously that the Perl code is underrepresented there.


Secondly, going through their ACTUAL number, it's clear that there's a ton of huge PHP CMS projects and similar that are going through social upheaval and forking rampantly.


So there's people listed as writing 1.5 million lines of PHP in 6 months. Many many PHP programmers are listed as doing so in fact.


They list 3000 projects. If we added eveyr CPAN module, we're making 3000 a YEAR.


The site is a write off

John Drago
2006-10-25 06:54:36
"There are more lines of VB written than in any other language."
-Microsoft


At least that's the position they held last time around. I wonder if anyone else has noticed it takes a lot more VB code to get anything done than, say, Perl?

Aaron 'Teejay' Trevena
2006-10-26 09:02:20
I'm thinking they used rather skewed sources, sourceforge has a huge ammount of PHP, which gives you only a picture of the kind of applications hosted on sourceforge.


There are also other things that make the survey pointless - it doesn't include CPAN, and perl, python etc are used heavily for bespoke development by professionals on inhouse systems - so you get a bigger and better selection of OSS infrastructure (frameworks, libraries, etc) than ready made applications, which are PHPs only strong point (IMHO).

rjbond3rd
2006-10-26 20:01:52
I would assume that Perl projects would tend to show fewer and fewer lines of code due to use of CPAN modules. Perhaps we should rank the languages on the inverse of SLOC to reward reuse.


In the spirit of the person who said "Ruby is an acceptable LISP," I would add that Perl is an acceptable Ruby and PHP, and Rails is of great value only to those who found that writing database-backed web apps was painful in the first place (e.g., Java folks, to cite only one example).


Also, while PHP and obviously Rails are used (almost) exclusively for web apps, Python and Perl are often used for apps completely unrelated to the web. It doesn't make sense to assume that they all address the same domains.


Finally, with all the emphasis on AJAX, do we really care so much what language the server-side part is written in? Personally, I'm spending as much time writing Javascript as Perl. As time goes on, the language used for the server-side seems to be a mere detail, an interchangeable component (like which SQL database is used).

Terabanitoss
2007-05-04 15:05:16
Hi all!
You are The Best!!!
Bye


Dandoy
2008-01-26 17:56:47
ladea
'Why statistics' provides resource material to support advocacy for official statistics and the agencies that collect, process and disseminate them, It provides access to good practice material within almost all of PARIS21’s main areas of activity. The material will be disseminated through the PARIS21 website and also on CD-ROM. The content includes specially prepared material as well as links to reference material and good practice from national statistical agencies, international organizations and research organizations.