Are Lines of Code really a measure of either success, productivity or popularity?

Via this and that, I found myself reading PHP Eats Rails for Breakfast

The title PHP Eats Rails for Breakfast and subtitle Despite the buzz around sexy new frameworks like Rails and Django, PHP is more dominant than ever initially commits the same fallacy that others have and that is to compare frameworks (Rails and Django) with programming languages. And then the suggestion becomes that one can interchangeably use Rails and Ruby, Django and Python.

New projects in their analyses were open source projects. And despite the popularity and open source availability of Rails and Django, they’re both relatively young and I can’t think of many open source and substantial applications written in both (all of our’s for example are closed source).

But the telling graph there is actually the last: more than 15% of “New Projects” are being written in Ruby. This counts “projects” not “net” lines of code.

Correct me if I’m wrong, but if 20 PHP projects do what most PHP projects have done and that is build out a custom “framework” that’s splayed out in /lib/ and /include/ directories, then they’re naturally going to have much more code than 20 Rails projects that are all taking advantage of the ~75,000 LOCs that’s present in the Rails framework.

What’s gets counted in a valid comparison then?

Would a 5000 LOC Rails application be equivalent to an 80,000 LOC PHP (non-framework using) application?

Do we get picky and only count the part of Rails or Django that actually gets “used”?

So when we have an application like Beast (svn, example forum) that implements a forum in about 500 lines of code.

How do we compare that to feature-comparable application in another language?

Rails is also a bit unique is that most people you see around only started coding in Ruby because of the Rails framework, and there aren’t many other examples of a single framework being so dominant within a language’s community.

I simply think the basic finding that’s in the title is just there to get some notice. I don’t quite have Gruber’s Jackass Stamp but if I did … someone might get stamped.

So what do you think?

Are they simply full of schnitzel or am I missing something?

Then in an Age of (Web) Frameworks, is there a relationship between LOCs and success, productivity or popularity?

How do frameworks impact typical metrics used by managers?

And it’s funny because we’ve had the same conversation internally where I’ll watch commits go by and then email someone and ask, “Is that feature really just 9 lines in our app?”

6 responses to “Are Lines of Code really a measure of either success, productivity or popularity?”

  1. I found that article pretty appalling as well. I, myself use PHP, but I also use the very nice framework that is CakePHP.

  2. According to this account of the early history of the Mac, the answer to the question in the title is “no.”

  3. I just came up with the tool that is capable of automatically solving virtually any problem by generating thousands of lines of COBOL code based on a verbal description of the problem. Now COBOL is the sexiest programming language on the planet! Woohoo!

  4. That data is 100% meaningless. As are, best I can tell, most intrepations of it. LOCs are of course a spurious measurement, since there’s really no way to isolate those lines of code into a meaningful statistic.

    I will say it’s amazingly silly to say

    but if 20 PHP projects do what most PHP projects have done and that is build out a custom “framework”.

    Since the data doesn’t imply the Ruby projects are Rails-based. It’s possible you’re right, but we’d need to query Ohlo before that type of conclusion could be confirmed.

  5. At my job for the upcoming release a few of us have set the goal of “more features, less code”. So for us, Lines of Code is a measure of success, but inversely so. We’re right on target, having eliminated several hundred lines of old code that wasn’t being used anymore or could be simplified.

    The app is Spiceworks and the usual “my views do not necessarily reflect those of the company” rule applies here.

    Check it out, it’s free and 1.0 will be released on Monday. Just (almost) outta beta!

  6. Source Lines of Code (SLOC) is rather useful for code estimation. In all the different methods I use to estimate a project, COCOMO II models tend to be the most accurate. You, of course, use different weights for language, framework, coder skill, past values, etc. So it kind of backs up what you’re saying. SLOC by itself measures nothing.

    I’ve written reusable PHP frameworks in under 7,000 lines that can complete for “tightness” of code written with RoR. Much of the reason I have to do this is resistance to third party libraries. It’s often seen as a liability. I have to make some compromises in design with PHP, but do so in the most elegant way possible.

    Like all languages, aside from Visual Basic, the true effectiveness lay with the developer. To say one is better than the other may be a bit ignorant. Each language has its strengths for the domain in which it’s used, aside from VB. This is why there continue to be so many. I like Ruby for the same reasons I like Smalltalk, but neither can do everything nor can PHP. I still need to write C++, even server-side now and again.

%d bloggers like this: