Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

American Programmers are Slackers

CmdrTaco posted more than 15 years ago | from the what-else-is-new dept.

United States 584

Amigan sent us a "Story on the CNN website how that in a world wide survey of programmers, American programmers are half as productive - based on Lines of Code generated!" Allright, I'm lazy, but in Perl thats ok. I find LOC a shoddy indicator of programmer laziness, but those numbers seem low- I mean, I probably wrote 15,000 lines of code last year, ran Slashdot, and was a full time student. I gotta put up a poll.

cancel ×


Sorry! There are no comments related to the filter you selected.

buggy lines (0)

Anonymous Coward | more than 15 years ago | (#1931831)

There certainly is an order of magnitude difference between the productivity of good and bad coders. A company that could reliably hire only the good ones could afford to pay them $200k per year and still make a killing.

However, you can't really measure productivity in lines of code. At the beginning of a new project, everyone writes tons of code. Once a project is fairly mature, maintenance involves more reading and less writing. I wrote about 14000 lines of code for my fun project last year, and only about 7000 lines of code at work, even though I spent much more time on the work code. Most of that, again, was on a couple of new projects. Less productive at work than at home? Nope, just spending a lot more of my time reading and debugging and testing and making one-line fixes.

LOC (0)

Anonymous Coward | more than 15 years ago | (#1931832)

If we write half the amount LOC they do, that means we're twice as efficient! (Well more so, since the files will be smaller, faster, etc...)

what languages did you code in? (0)

Anonymous Coward | more than 15 years ago | (#1931833)

Well, I Learned COBOL and RPG (yes, I'm laughing, too) in skool, but now I use C PERL and Shells.


Fewer LOC = more efficient programs? (0)

Anonymous Coward | more than 15 years ago | (#1931834)

... or the exact same code with less debug code in it (traces, exceptions, asserts, etc. all the things that make working with other programmers bearable.)

what languages did you code in? (0)

Anonymous Coward | more than 15 years ago | (#1931835)

I'm involved in a large E-commerce package and wrote a simple parser in JAVA to handle "enhanced" HTML pages. This includes code to access live data from a proprietary BBX accounting package and a SQL interpreter. There's also some PERL and JavaScript code involved.

So, approx.
Java - 5K LOC
JS - 100 LOC

Sam (Yep, still too lazy to create an account)

Does TeX code count? (0)

Anonymous Coward | more than 15 years ago | (#1931836)

Or even LaTeX?

100K (0)

Anonymous Coward | more than 15 years ago | (#1931837)

100K each in '96 and '97

buggy lines (0)

Anonymous Coward | more than 15 years ago | (#1931838)

STUPID engineers produce 10 lines of code a day.
Brilliant ones can do orders of magnitude more

No, STUPID engineers produce 10 lines of code a day.
BRILLIANT ones produce 5 lines of code a day, because they now how to things right and efficient without bloat.

LOC is for idiots (0)

Anonymous Coward | more than 15 years ago | (#1931839)

I agree. As most of us who have done any coding realize, the elegant, simple 20 line function is always preferred to the clunky, hard to maintain 100 line function. The first programming lesson you learn is how to print "Hello World" on the screen five times. The second lesson you learn is how to use a loop to do it in a three lines of code. LOC == laziness? Methinks not.

Assembler... (0)

Anonymous Coward | more than 15 years ago | (#1931840)

Does a line of assembler count as more than a LOC becuase it takes longer, or less because it does less?

Oh, pick me pick me pick me! (0)

Anonymous Coward | more than 15 years ago | (#1931841)

Person 1, because most of the extra 10K is likely to consist of comments.

Object technology (0)

Anonymous Coward | more than 15 years ago | (#1931842)

Wasn't this sort of thing supposed to go out with procedural languages? IMHO, I would guess that many other countries use more procedural (read:older) languages than in the U.S. Probably a good chunk of the first world is looking more to OO tech (US, Canada, most of Northern Europe, Japan, etc), but how much OO development do you think is going on in Chin, Russia, Malysia, etc?
Less code per year makes sense in environments where OO technology is being implemented: There is more planning, MANY more work products, and code reuse seems to be preached more often. Call OO environments more design and analysis intense, less code intense. Less KLOC's sounds good to me.
If you keep preaching KLOC's, eventually your code will look like crap. (remember when Pointy Haired Boss was going to pay by the bug fix, so Wally was going to "code himself a mini-van this afternoon?"


Vindication! (0)

Anonymous Coward | more than 15 years ago | (#1931843)

I prefer the latter. You waste a whole line
the other way. I find it nice to see as much
code as possible on one page.


When linux kernel changes languages, only then... (0)

Anonymous Coward | more than 15 years ago | (#1931844)

will I believe that C is not _the_ primary language of choice. C has achieved that mystical balance between being low and a high level language while being itself a small language. Nothing else has yet matched this. Everything else is either too bloated, an ugly add-on kluge to C, a scripting language that is too limiting for many necessary uses, etc.

C is still king.

BTW, I'm European (0)

Anonymous Coward | more than 15 years ago | (#1931845)

And `South American'.

Is this becouse of development packages? (0)

Anonymous Coward | more than 15 years ago | (#1931846)

No kidding! Ever do much GUI work with the visual editor in VAJava? WOW, talk about extra lines of code!

what languages did you code in? (0)

Anonymous Coward | more than 15 years ago | (#1931847)

At work: Natural, SQL, APL, UNIX Scripting & MVS JCL.
At home: C, UNIX scripting, SQL, APL & just starting to play with Perl.


Quality, not quantity is what counts (0)

Anonymous Coward | more than 15 years ago | (#1931848)

4th sem NAIT CST

Question: Comments included in LOC (0)

Anonymous Coward | more than 15 years ago | (#1931849)


Does the LOC count include comments?

Is this IBM and K-Locks all over again? (1)

Anonymous Coward | more than 15 years ago | (#1932024)

IBM used to pay their programmers for lines of code.. This is the most idiotic thing I've ever heard. Writing more lines of code doesn't make you productive, it makes you a poor programmer.


Is this IBM and K-Locks all over again? (1)

Russ Steffen (263) | more than 15 years ago | (#1932033)

Paying programmers by the number of lines they produce is only slightly less dangerous than paying firemen by the number of fires they put out.

The only thing worse would be paying them by the number of bugs they fix.

It's a corporate thing (2)

Tony Shepps (333) | more than 15 years ago | (#1932034)

Just before I graduated in 1985 (so what) I heard a statistic: the average professional programmer writes 14 lines of code per day.

I thought: WOW, I'm going to crush these people. They have no idea. So I got out into the real world and my first job was at Sperry (now Unisys), coding in the OS "kernel" for the series 1100/2200 mainframes -- although it wasn't really a kernel since they had never developed it along the lines of a proper OS.

I quickly learned that "14 lines per day" wasn't because these people were stupid; it was because of all the other crap that had to accompany those lines. In particular, one 500-line modification I added also required 50 pages of (mostly bureaucratic) definition and design documentation and about four months of politics.

Sperry circa 1985 is no longer a good example, but I'm sure that programmer's productivity everywhere is still completely stymied by corporate cultures that require signoffs from 7 different executive vice-presidents just to decide what doughnut selection is available in the breakroom. ("Operations is worried that powdered sugar is getting into the air vents, Personnel is angling for lower fat content to save on insurance premiums, and Steve in marketing wants them all chocolate because HE likes chocolate so therefore the rest of us should too.")

what languages did you code in? (1)

Enry (630) | more than 15 years ago | (#1932046)

I write mostly in PHP and Perl (since a lot of stuff is web based). You should also take a look at Python and SQL. Not to mention C.

Maybe we're just more efficient. (1)

gavinhall (33) | more than 15 years ago | (#1932048)

Posted by The Trailer:

I would think that generating fewer lines of code would be a mark of excellence in this industry, not laziness. I'd much rather produce an elegant 7700 lines of code than 16,000+ lines of bloatware.

oh well.

Yep, I AM lazy... (2)

gavinhall (33) | more than 15 years ago | (#1932059)

Posted by FascDot Killed My Previous Use:

...but not unproductive.

Laziness is a VIRTUE in a programmer. "Man, I don't want to keep doing this. I'll write a program to take care of it." "It'll take me forever to write that program; there must be a faster way." Etc.

Last year... (1)

Vorx (876) | more than 15 years ago | (#1932064)

50k line accounting package, windows though..

Guess that puts me in the 20k+ group, heh...

Oh well, now I get to maintain that program, and write cool things in perl, c/c++ and java...

I like my job :)

Homework => 5000 loc (1)

bjk4 (885) | more than 15 years ago | (#1932065)

I wrote a whole bunch of code for classes last year. I had 5 compiler theory programs that each were around 1800 loc. Took me a while, but it all worked.


Code to Live, Live to Code (1)

Bryan Ischo (893) | more than 15 years ago | (#1932066)

At work, approx 50,000 lines
At home (personal projects) approx 15,000 lines

The 50,000 lines were Java, the 15,000 C and C++

I wish the totals were reversed, but unfortunately I have to code what other people want me to code so that I can feed myself and then code what I want to code on my time off ...

SIZE doesn't matter, it's what you DO with it... (0)

zonker (1158) | more than 15 years ago | (#1932073)

This sounds like the fabled Microsoft vs. IBM programming teams, where IBM employees were supposedly being paid per LOC and Microsoft employees were being paid for the job they did. The story goes that for every 10 LOC IBM wrote, Microsoft optimized it down to 1. Then they started making the IBM team look bad and things started to fall apart from there. I believe this was back in the early days of OS/2 (slightly before Microsoft excercised their license agreement and came out with their own OS/2-like system, Windows)... I guess it is the amount of code that you write that matters, not the quality, according to CNN anyway.

Too bad Microsoft can't release a program today that isn't over 100 meg compressed. That is partially why I am big into shareware and freeware, where you can often find a nicely featured, solidly written program that does what you need. For example: JASC's Paint Shop Pro. Okay, sorry you Linuxheads... The Gimp is wondiferlous too... Unfortunately, my job requires me to use Wintel machines all day...

Oh... For one decent program written outside the US, I'll name 10, no 20 programs that have been written in the US...

Yeah, but what exactly is a 'line of code'? (2)

root (1428) | more than 15 years ago | (#1932077)


#include <stdio.h>

int main(int argc, char **argv)
printf("Hello, world.\n");
return 0;

How many lines is that?
7? (total lines in program including blank lines)
6? (ignoring blank lines)
4? (is '{' and '}' really a 'line of code'?)
3? (#include is not really code)
hundreds? (stdio.h is huge and includes many other header files)

LOC is for idiots (1)

Tom Bannon (1447) | more than 15 years ago | (#1932078)

Program A

Software person 1: does it in 20k lines

Software person 2: does it in 10k lines

Which is likely the better program & programmer?


"I would have wrote it shorter, but I did not have the time" - gist of a famous quote

Is this IBM and K-Locks all over again? (1)

Thomas Charron (1485) | more than 15 years ago | (#1932085)

No, but a guy who writes 5,000 lines that work well and are thought out IS better then the guy who just kicks out 10,000 lines of hack.. ;-P

Is this becouse of development packages? (1)

Thomas Charron (1485) | more than 15 years ago | (#1932086)

I wonder if this is due to the development tools used. I'd like to see how many of those lines where part of Visual C++ programs, where Microsoft, in their supreme wisdom, writes half the code FOR you..

Is this IBM and K-Locks all over again? (1)

Matts (1628) | more than 15 years ago | (#1932098)

What a ridiculous sweeping statement. So the guy who writes 1 line of code a year is better than the guy who writes 10,000?

Lines of *what* code? (1)

ChadG (1680) | more than 15 years ago | (#1932099)

You forgot to add:


"In true sound..." -Agents of Good Root

Warm squishy feeling, a poll about US! (1)

extremely (1681) | more than 15 years ago | (#1932100)

It's nice to see a poll that really relates to my life...

20k++ aww yeah...

LOC is for idiots (1)

tgd (2822) | more than 15 years ago | (#1932118)

How about:

Software person 3: writes a perl script to remove all the newlines


Which is the bigger pain in the ass, that's the question!

Letsee now... (1)

Svartalf (2997) | more than 15 years ago | (#1932120)

C, C++ (they ARE different...), Pascal, Ada, Forth, Basic (UGH- thank the Lord I'm not doing VB anymore!! :-) , TCL, Perl, Awk.

I've used all of these in my career with C, C++, Object Pascal(Delphi), and Perl being the most recently used ones...

20+ Kloc? 100 Kloc? (1)

Svartalf (2997) | more than 15 years ago | (#1932121)

You guys are nuts (but then so am I... :-)!

As it is, I claimed I did 15k-19,999; it seemed like boasting to claim the 20+ Kloc slot (Even if it is very true!), and I try not to boast... :->

Depends... (1)

Svartalf (2997) | more than 15 years ago | (#1932122)

Depends upon how many apps/libs/etc. you're doing that coding to. I had to work with over 20 differing components for document imaging, some of which I started from ground zero, some were written by others and I had to pay for THIER sins (i.e. I had to rip it apart and put it back together, literally making a new component)- and had to worry about 16 versus 32 bit code, 95 versus NT (Because they ARE different in MANY ways), doing things with APIs that are plain flat broken (use wise- they SCREAM at doing what they do...), having to roll your own imaging functions because some of your libraries don't do enough to make the component work the way that the exec wants to)

It actually depends on what you're doing- you could be doing very quality stuff (I did as few lines/operations as possible...) but you could be doing a lot of it.

It really depends... (1)

Svartalf (2997) | more than 15 years ago | (#1932123)

What if Programmer A's code is more stable, does error checking, etc.? I'd say that it was A that did a better job than B. Which, of course, helps prove the point you were reaching at- your premise is a bit off, that's all...

How true hackers use fewer lines to do the job. (1)

smithdog (3152) | more than 15 years ago | (#1932125)

This has been around for many years. Seemed like an appropriate response. on.htm

Fewer LOC = more efficient programs? (1)

Lamont (3347) | more than 15 years ago | (#1932128)

I'm not a programmer, but I've always worked under the assumption that if you can program the same features/functions in fewer LOC, it's a more elegant and efficient program.

Quality vs. Quantity (2)

SpiceWare (3438) | more than 15 years ago | (#1932131)

At my prior job, an Indian company was outsourced to re-write the company software for a migration off a Wang system onto an AS/400 with client/server support for PC systems. I had a few problems trying to make revisions to the code that definitely lowered my productivity:

  • variable names were ambiguous(for an English speaker at least) which made it hard to follow the programs
  • spagetti code was rampant, goto's everywhere. It reminded me of my days on the Commodore 64. At least on the C=64 you had to use GOTO
  • entire sub-routines were routinely disabled by placing a GOTO as the first line of the sub-routine, where the destination was the end of the subroutine. This not only had the effect of inflating the lines of code written, but it also made me less productive by making the program much harder to follow (all the calls to the null-subroutine were still active)

I suspect another issue is that American companies in general have been computerized longer than companies in other countries. This would imply that more work in the USA would be done on maintenance than on developing new code. Maintenance work tends to produce fewer lines of code due to the time spent analyzing the program before changes can be written and applied.

Less is More (1)

James Youngman (3732) | more than 15 years ago | (#1932136)

It's important to remember that writing fewer lines of code is better than writing more, provided it gets the job done.

Fewer lines of code means fewer bugs, and usually makes the program easier to understand (since there is less code to read). There is a point where brevity turns into obfuscation, but that is usually on the micro-scale, and usually doesn't apply to whole programs.

buggy lines (1)

Frederic54 (3788) | more than 15 years ago | (#1932137)

it depends, when there's a bug in a line, i rewrote it... anyway the number of line of code per engineer per day is less than 10

code generator (1)

Frederic54 (3788) | more than 15 years ago | (#1932138)

why write code when program can write it for yourself? i'm using the ApBuilder from QNX [] /Photon for those who know it, i click 2 or 3 times, write a label, click generate, click make and it works! then i can do a wc -l *.h *.c and wow what's a number! :o)

what languages did you code in? (1)

Mark Storer (4097) | more than 15 years ago | (#1932143)

I'm split about 90/10 in C++/Java, with a sprinkling of (ready?) Lingo. Yep, Macromedia Director: Oh, the pain.

latex? (1)

robbo (4388) | more than 15 years ago | (#1932148)

19000 c/c++ code for my Master's thesis.
+another 3600 lines of latex code for the document itself. Does anyone know if latex is Turing complete?

what languages did you code in? (1)

zempf (4454) | more than 15 years ago | (#1932150)

I've noticed that to be true here. As I said in the article on whether or not geeks should attend college, I find the inclusion of COBOL in the curriculum here to be pretty dumb. I realize it's still in wide use in a bunch of older systems, but I dunno, methinks I'd rather learn something that'll have more future applications. As far as actual use, I do most coding in C++, whether for class or for personal use.

-mike kania

Brian?!? (0)

Breakdown (5084) | more than 15 years ago | (#1932159)

Brian?!? I think you should leave him out of this. He hasn't harmed anyone.

Why not use a real language? (1)

Chris Hall (5155) | more than 15 years ago | (#1932160)

Surely the solution is simple: write everything in INTERCAL [] .

what languages did you code in? (1)

piggy (5857) | more than 15 years ago | (#1932166)

It really depends on the purpose.

Work: Ada almost exclusively. Some Perl scripting.
Home: C, C++, Java, Perl. Dabbling a bit in Objective-C.

Russell Ahrens

buggy lines (1)

perry (7046) | more than 15 years ago | (#1932173)

STUPID engineers produce 10 lines of code a day.
Brilliant ones can do orders of magnitude more
than that. I've heard this idiotic statistic
for years -- I've never believed it, largely
because it does not in any way match experience
with smart and educated programmers.

(To the tune of the Meow-mix song) (1)

Geoff NoNick (7623) | more than 15 years ago | (#1932176)

C C C C, C C C C, C C C C C C C C

and some Java for school (yech)

Yeah, but what exactly is a 'line of code'? (1)

fishbowl (7759) | more than 15 years ago | (#1932178)

It's ONE.

The function declaration and the return are
not procedure steps... Okay maybe the
return is. So it's two maybe.

too low! (1)

Rob_D_Clark (8341) | more than 15 years ago | (#1932181)

20k loc is too low! I've done that in six months!

what languages did you code in? (1)

ekb (8426) | more than 15 years ago | (#1932182)

Fortran baby!

(And C when I am not changing already existing code...)

buggy lines (1)

gampid (8492) | more than 15 years ago | (#1932184)

I've found that the number of lines I write can really depend on what I'm doing. Writing perl data munging scripts and web bots can take only a few lines. When you write code that does interface stuff the lines shoot up. It's a really rough estimate. I said 15 to 20, but thinking about it's probally more. Who actually keeps track of this kind of stuff?

LOW numbers???? (1)

Dictator For Life (8829) | more than 15 years ago | (#1932188)

I don't get these numbers. 20,000 lines, in 50 weeks, is just 400 LOC/wk. Just 400 lines? Ha! No problem where I work. Granted, we're not writing C, but heck... I know I do at *least* 400 LOC per week. And there are three of us.

what languages did you code in? (1)

Dictator For Life (8829) | more than 15 years ago | (#1932189)

To earn a living: FoxPro (yes, I know. But Visual FP is OOP, and it's miles better than VB).


  • Perl
  • C
  • VB
  • Shell
  • ...and a tiny bit of C++

Lines of *what* code? (1)

UncleRoger (9456) | more than 15 years ago | (#1932193)

In what language are these lines being written? I wrote an awful lot of COBOL code last year, much less in BASIC, Perl, etc. COBOL requires a *lot* more lines of code to do the same tasks as other, more terse languages.





could probably be done in a lot less lines in another language. Perhaps even one line, making for an 80% reduction in the number of lines of code.

Then, of course, there is the whole issue of efficiency -- writing more lines of code does not mean better code, or even more functionality.

what languages did you code in? (1)

UncleRoger (9456) | more than 15 years ago | (#1932194)


COBOL (80%)
Powerhouse [] (12%)
Visual Basic (3%)
JCL/Scripts/Macros/Etc. (5%)

Home/Fun/Personal Web:

QBasic (MS-DOS) (45%)
Perl (45%)
Visual Basic (10%)

And before you laugh at me for being a COBOL programmer, keep in mind that I made a ton of money last year, working from home in the buff. So there. 8^)

All schoolwork! (1)

cpeikert (9457) | more than 15 years ago | (#1932197)

One software engineering class: >7000 lines

One compiler engineering class: >6000 lines

Fun code for myself: 100 lines.


Some tasks don't generate lots of LOC (1)

kzinti (9651) | more than 15 years ago | (#1932198)

Last year, I led a project to port an AP101 emulator (virtual machine) from RS/6000 assembly language on AIX to portable C++. We didn't generate a huge new codebase, but we were very productive. Some very productive days, I didn't write a single line of code -- I disassembled and documented RS6K assembly trying to understand how the emulator worked (the original programmer was long since gone and didn't comment his code).

Lots of programming jobs in this country involve porting. Lots of others, especially as we approach Y2K, are involved in maintenance of existing codebases. Many other tasks consist of tweaking and tuning existing code. Still others are integration projects -- taking existing bodies of code and making them work together.

Given that the US has been using computers as long or longer than any other country, it's possible (probable?) that we have a higher percentage of our programmers in these maintenance-type jobs. I'd bet that if you compare productivity of programmers whose jobs are exclusively to generate new code, the US would stack up better.


I'll include "War and Peace" in all my programs... (2)

tuffy (10202) | more than 15 years ago | (#1932203)

I figure the full text, commented out at the end will add to my productivity immensely! But seriously, haven't we gotten out of the "more lines of code are better" mentality back in olden days? From what I can tell, American programmers aren't better or worse than other programmers all over the world, so why do we need this ridiculous metric to tell us what to do?

Loopholes (1)

Laxitive (10360) | more than 15 years ago | (#1932205)

So far it looks like an even spread. 2 for "less than 1000" and 2 for "1000-1500".

I think most people here would be in the "less than 1000", including me. Of course, if you count all the lines of code that 1 line of python code leverages.. I guess you could argue that I wrote more than 1000.

And I'm sure some guy out there will just run vi (or emacs for the sorry vi-challenged people), type one ' printf("wheee") ', and then yank and paste 'till the sun comes up, and legitimately call it his 1000 (or 1000000) line program...

lotsa loopholes.


LOC? Who even knows? (1)

Arkham (10779) | more than 15 years ago | (#1932207)

I have NO idea how many lines of code I've written in the past year. None. This year I have written 6 complete dynamic-content web sites in Python and Perl. I have written about a dozen freeware and shareware programs. I've done about 6 dozen CGI scripts for various purposes. I've done a lot of RealBasic programming on my Mac just for the fun of it. How efficient am I? I don't know. All of my code works, and it all does what I intended for it to do. Isn't that what matters. Don't blame CNN, because they just report what other people give them. Blame the idiots that released the study.

buggy lines (1)

Blake (11414) | more than 15 years ago | (#1932214)

Brilliant engineers don't need to produce orders of magnitude more code than 10 lines a day.

Two stories:
A person is sitting near me at my current company. He's not the brightest person I've met, but man does he code. He's written more lines of code than most of the rest of us put together. Most of it is crap.

My boss once made a fix to a driver for some random hardware the company he worked at was building. It was a 2 byte fix, but it took a week to find and make. It's one of the pieces of code he's most proud of.

A good programmer should be able to write excellent code. A great programmer is someone who knows when they don't have to.


I speak for PCDocs

what languages did you code in? (1)

Blake (11414) | more than 15 years ago | (#1932215)

At the workplace:
Visual C++, Visual Basic, VBScript, JScript, Java. HTML too, but I don't consider that coding.

Python, C++ (Mmmm... STL...), C, a smattering of Perl.

Say, that would be an interesting poll question. Is there any way we can select more than one option in the poll?


I speak for PCDocs

Lazy or effecient? (1)

Col. Klink (retired) (11632) | more than 15 years ago | (#1932217)

Here I thought that I was extremely productive when I scrapped a 1,000+ line program written by a predecessor and rewrote it in under 100 lines. I guess programmers who reuse code are less productive than then brute-force coders.

don't know why... (1)

stimpy (11763) | more than 15 years ago | (#1932219)

my first name is one of the choices, but my pick was obvious...

nah, (1)

NeuroKoan (12458) | more than 15 years ago | (#1932225)

We americans just write more eficient code

what languages did you code in? (1)

jabber (13196) | more than 15 years ago | (#1932230)

Mostly Java at this point. Some C/C++, and looking into Delphi. As recently as two months ago, I worked with FORTRAN every day, and swatted at VB(A). Also looking for an excuse to pick up Perl and maybe Python skills on the side.

Actually, here's a kick - speaking of lines of code written: Just the other day I needed to write a really ugly if-elseif in Java... Went on for, oh hundreds of lines... I whipped up a ksh script to write it for me. Took 7 lines. Which counts? The script or the generated code??

And, while on the subject of LOC: If I use VC++6.0, and run wizards, do I get to count those gen'd lines toward my raise??

Laziness is the mother of invention... (3)

DLG (14172) | more than 15 years ago | (#1932235)

I don't really know why it would be American versus the rest of the world or whatever, but I have always considered laziness as a virtue. Generally it motivates people to produce time/energy savers such as cars, compilers (I know, some of us just love to handcode stuff in whatever our favorite executible format is, but personally I dig how much C and perl accomplish...) and toilets.

I cannot even vote for how many lines of code I have written. Probably 100 different projects between 10 and 1000 lines of code, but most of them really involve cutting and pasting. Hell, if I wasn't so lazy I would probably be using more modular code than I already do and thus write even FEWER lines of code.

I expect on the otherhand that they didn't actually ask any of the Microsoft OS developers. From what I understand they write kajillions of lines of code, as they have to rewrite the OS over again everytime they make a revision.

Wheras with Linux generally you take someone elses code and rewrite the important differences.

So is OpenSource's real value the way it supports laziness? I mean there are all sorts of projects I have done where I have looked for appropriate open sourced code before hand coding. Is this wrong? I would say that a real measurement of productivity would be how much a single programer could accomplish with the fewest number of lines but since the majority of the lines of code written by US programmers are actual productivity wasters like games it is somewhat ironic...

Productivity is measured by how much work an individual can accomplish in a consistent amount of time. The notion that writing more lines of code as getting MORE done in less time is far fetched.

Lazy=good or we would still be hunter gatherers.


what languages did you code in? (1)

Maciej Stachowiak (14282) | more than 15 years ago | (#1932237)


C, C++, Java, Perl, C Shell, Bourne Shell


C, Scheme

Like Judging a Car based on its weight. (1)

Zebulun (14800) | more than 15 years ago | (#1932239)

Two things:
1. yes i am a lazy programmer, but also a fairly
good one when i do code.

2. I think this whole article/way of judging
programming is exactly why bloatware exists
today. People seem to judge programs based
on how much space they take up, not by how
much they can do. 5 years ago people would
never have believe MS Office could take up
more than 5 or 10Mb.. whats it up to now? 80
100 120Mb? what new things can you do with it?
its bloatwareitus.


It would be interesting to ask (1)

richnut (15117) | more than 15 years ago | (#1932242)

What percentage of the code was written for an employer and what percentage was written for a personal or free project.


what languages did you code in? (1)

richnut (15117) | more than 15 years ago | (#1932243)

It depends on what you have to do. As a sysadmin everything I wrote was in ksh, or tcl, with some C hackery to extend the functonality of existing programs. System administration does not require complicated software, most if it is generating or reading some sort of report automatically and for those kinds of things interpreted languages excel. We used TCL becasue my boss, the original author of most of the systems, had extensive background in TCL.

At my new job I've done very little coding at all, and everything I write at home is in perl.


Some merit to the story (1)

webslacker (15723) | more than 15 years ago | (#1932248)

LOC is definitely no way to measure quality or productivity, but there's some truth to the story. Many software houses have become so successful that many programmers with stock options have become filthy rich. The result is that the programmers have less incentive to put in extra time and energy for coding. They're rich alreay! Why work hard? There was an article a while back on CNet or ZDNet (can't recall which) which offered that explanation for the recent bloatware proliferation and why Windows2000 is running into so many brick walls.

Of course, that only happens to the programmers who don't code for the fun of it. =)

Welllll.... (1)

jwriney (16598) | more than 15 years ago | (#1932263)

By the same logic, Windows 2000 must be a much more productive operating system than anything else, since it's running about 35+ million lines of code, by the best estimates.

(sarcasm mode off)

--John Riney

hours.. (1)

mhat (17077) | more than 15 years ago | (#1932270)

So i'm curious, why do all the programmers I know spend 60-100 hours a week at work? (myself included)

Further, that paper takes no account for the quality of the code - I can write a functional hack in a few hundred lines of code , and then have to rewrite it to do something a little different. OR I can designe one thing, which is
abstract enough to do all of what i need. It takes less code, but more time to do correctly? Does this make me slack?

LOC does not always measure productivity. (1)

CodeShark (17400) | more than 15 years ago | (#1932273)

On the surface, it looks like we American programmers are a lazy bunch on adverage, but look deeper. As a very experienced programmer, I can tell you that I write perhaps 1/4 as much code in a day than I did several years previously, and get paid more. Does that mean I am slacking? Absolutely not, and here's several reasons why "lines of code" is not the best measure:
  1. The "right" solution to a programming problem often requires much less code. Not long ago I reduced a billing subroutine from 1100 lines of code to just over 150, and increased the speed of that process by a factor of 4, with higher data reliability as well. It took about three days to figure out the logic, but only an hour to code it.
  2. In another project, I churned out about 3,600 lines of good foundation-class type C++ code in about 10 weeks. As I am working on projects now, however, I simply reuse the components created as part of the library, which allows more rapid development, but requires less new code.
  3. State of the art programming tools and languages require less hand coding and lower LOC counts to achieve a given result.
Am I therefore less productive? I don't think so, and neither does my boss. While I have met a few programmers I would define as slackers, most of them didn't last very long, are low paid, and marginalized by their own low quality work.

slackers... (1)

pfaut (18898) | more than 15 years ago | (#1932283)

Yeah, we're lazy. But I once heard that if you want to find a more efficient way to solve a problem, give it to a lazy person....

LOC Inaccurate (1)

Rolan (20257) | more than 15 years ago | (#1932296)

Really LOC is an innaccurate way of showing productivity. I could make a given language print Hello World! in 12 lines (one letter per line) or in 1 line. The fact that american programmers produce fewer LOC than others might just mean we produce more efficient code...

what languages did you code in? (1)

scherbi (21342) | more than 15 years ago | (#1932304)


Lines of code == productivity? sweet! (1)

for(;;); (21766) | more than 15 years ago | (#1932313)

Kick ass! Here I thought I had to write robust, elegant code to be productive. Now a CNN reporter (I didn't see the name -- was it Knuth? I heard he's working for them now) tell's me it's all about the number of lines of code. Thank god! Time to double-space my comments.

what languages did you code in? (1)

endgame (23042) | more than 15 years ago | (#1932324)

I'm in the middle of getting a BS in comp sci and I was just wondering what languages most people actually use, whether in the workplace or in their academic lives. What people actually use to get work done is not something we learn a lot about in college.

You're right! (1)

theCoder (23772) | more than 15 years ago | (#1932329)

Measuring by lines of code is dumb. Depending on your style, you could end up with hundreds of lines difference for the same program. And besides, more lines of code isn't necessarily good -- it could just be inefficient. We don't grade surgeons on the number of incisions they make do we? And we don't grade painters based on the number of paintings they paint. Number isn't everything; quality is much more important.

Quality not Quantity (1)

PantherX (23953) | more than 15 years ago | (#1932331)

Isn't less code that does the same work better?

LOC? LOL. (1)

dewey (25683) | more than 15 years ago | (#1932335)

LOC/year is a stupid measure of productivity. If I write 5000 lines of code a year, and all of them are correct when I deliver them, does that make me half as productive as someone who delivers the same program in 8000 lines and then must rewrite 2000 lines to fix bugs (total of 10KLOC/year)?

It's typical of Suits to force a quantitative measure on something that's fundamentally unquantifiable so that they can measure and judge and compare without actually *understanding* what they're talking about. And it's sad when these bogus measures are used by management to promote people or by journalists to prove a point that's not there.

Good for you! (1)

Jburkholder (28127) | more than 15 years ago | (#1932342)

I was afraid if I replied to this thread, I would be the only COBOL programmer! Made a lot of money 'fixing' all that y2k 'infected' COBOL source last year, the rates are double if you waited till this year. They'll go up even more if I have to come back next year and fix something some else missed.

Planning on retiring the year after that!

Good for you! (1)

Jburkholder (28127) | more than 15 years ago | (#1932343)

Oh, and I didn't 'write' any lines all last year, only changed ones that were already there (about 10,000)

what languages did you code in? -Perl (1)

Guppie (28783) | more than 15 years ago | (#1932348)

I'm just finishing my master thesis, which revolves around a 1172 lines long Perl script.

At my faculty, we're pretty much free to use whatever language we like for our master thesis, in the undergraduate courses they can choose between Java, Pascal, and C(++).

what languages did you code in? (1)

selectap (30841) | more than 15 years ago | (#1932358)

Java and (yuk) a little bit of asp...

And that was PERL! (1)

eriks (31863) | more than 15 years ago | (#1932367)

apprx 5000 lines of perl... granted, prolly 1/3 of the code was just printing lines of html...
(Customer Database interface for a big ISP)

I shudder to think how much code that would have been in VB or some other icky language like that.

Nice poll tho!

Vindication! (1)

uncarvedblockhead (32775) | more than 15 years ago | (#1932373)

For years I have believed that:


was better than


Now I have objective proof! My way is 33% more productive!

Less is More (1)

uncarvedblockhead (32775) | more than 15 years ago | (#1932374)

I once wrote a thousand line program in one day. About the same period in my life, I wrote a 10,000 line program over a period of about three months.

Guess which one was the one-off piece of crap that I hope no one ever sees and which one was the elegant solution of which I am proud to this day?

LOC is for idiots (1)

PapaZit (33585) | more than 15 years ago | (#1932383)

While this was my first reaction (shorter is better), here's a counterexample:

Almost any function can be written in one line of perl. That line will probably resemble line noise.

Is it better than a neat, 20 line function? It may show mastery of the language, and it may impress your fellow geeks, but it won't impress the person who has to figure it out 2 years later at 4am.

I've rewritten code before, with a good 20:1 expansion ratio, because the original code was too clever for its own good. I've even rewritten my own code before, when I realized that nobody else (at least, nobody sane) was ever going to be able to figure out how or why I wrote something the way I did, even when the original, shorter way was more 'elegant'.

what languages did you code in? (1)

sds (94773) | more than 15 years ago | (#1932413)

I use Common Lisp for most of my projects.
See why at
Load More Comments
Slashdot Login

Need an Account?

Forgot your password?

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>