Alex Rivera | Logout

When, if ever, is "number of lines of code" a useful metric?

Asked 2008-10-08T18:13:27.557
59

Some people claim that code's worst enemy is its size, and I tend to agree. Yet every day you keep hearing things like

  • I write blah lines of code in a day.
  • I own x lines of code.
  • Windows is x million lines of code.

Question: When is "#lines of code" useful?

ps: Note that when such statements are made, the tone is "more is better".

Edit
Report

3 Answers

12

Reminds me of this:

The present letter is a very long one, simply because I had no leisure to make it shorter.
--Blaise Pascal.

answered 2010-11-23T14:26:28.303
3

I'd agree that taking the total number of lines of code in a project is one way to measure complexity.

It's certainly not the only measure of complexity. For example debugging a 100 line obfuscated Perl script is much different from debugging a 5,000 line Java project with comment templates.

But without looking at the source, you'd usually think more lines of code is more complex, just as you might think a 10MB source tarball is more complex than a 15kb source tarball.

answered 2008-10-08T18:20:38.087
0

I have found it useful under two conditions:

  1. Gauging my own productivity on my own new project when it's heads down coding time.

  2. When working with a large company and speaking with a manager that really only understands widgets per day.

answered 2008-10-08T18:18:41.367

Your Answer