
Ask HN: How many lines of code do you deliver every day? - ryanwaggoner
This might be a useless question, but I'm curious.  I was reading the comments on another post and someone referred to the fact that they used to produce about 10x as many lines of code when they were at a startup as they do now that they have a corporate job.<p>I know every programmer and every language is different, but roughly how many lines of code do you deliver every working day, and do you work at a startup or a corporate gig?  Feel free to throw your language in there too :-)
======
nostrademons
It's really hard to use a daily LOC measure. Some days I'll just be cranking
out boring stuff, in which case it could easily be 300 lines a day (my record
was about 1200 lines in the 24 hours before my OS design final project was
due). Other times, I'll _remove_ 90% of those 300 lines because I found a more
efficient way to write it. Still other times will be pure design or research.

That said, here're some long-term averages for projects I've worked on, with
total code size divided by project duration. Except for FictionAlley and my OS
design course, I've adjusted for working days when figuring out lines/day (so
GameClay uses a 7 day/week schedule while projects for my employer figure on
only 5 days/week).

First professional job, startup, Java Swing, 1200 lines in 2 months. ~30
lines/day.

FictionAlley.org, part-time nonprofit volunteer work during college, PHP, 8000
lines in 3 years. ~10 lines/day, but that includes many days when I didn't
work on it at all.

OS Design final project, college course, C++, 8000 lines in 4 months. ~67
lines/day, ostensibly part-time but this course ate my brain so much it might
as well have been full-time. The result didn't really work, though.

Scrutiny, college volunteer project done over vacation, PHP, 761 lines in 2.5
weeks. ~40 lines/day.

Write Yourself a Scheme in 48 hours, part-time hobby project, Haskell, 400
lines in a month (not counting time to write up the tutorial). ~10 lines/day

Second job, startup, Java Netbeans plugin. 20,000 lines in 5 months. ~200
lines/day.

Same employer, JSF trade-verification webapp. 40,000 lines in 12 months, but I
had a partner. ~70 lines/day.

Gameclay, my own startup, Python + JavaScript. 18,000 lines in 5 months, not
counting false starts we threw away (that'd be another 3 months, +8 months
part-time). ~120 lines/day.

ArcLite, hobby project (but given my full attention), JavaScript. 1200 lines
in 8 days. ~150 lines/day.

Tetris, hobby project, JavaScript. 321 lines in 5 hours. ~500 lines/day.

YC startup, 657 lines of JavaScript in 6 days, plus there was some Django and
server setup that I didn't count. ~100 lines/day.

Eve, hobby project, Haskell. 1773 lines in 2 months. ~60 lines/day.

WhatShallIDoNow.net, hobby project/startup, Python & Django. 400 lines in 4
days. ~100 lines/day.

------
makecheck
Please don't ever ask about "lines of code". This measurement means
_absolutely nothing_ , and I've been programming for over 20 years. Any
responses would be misleading at best.

There are huge programs that should be tiny. And there are small programs that
are so clever that they're unmaintainable, and should be bigger. There are
many ways to show that lines of code won't tell you what's really important
about a program or programmer.

~~~
tyn
Program A has 20 lines of code. Program B has 20.000.000 lines of code. Is
this absolutely meaningless information?

~~~
qwph
Bearing in mind that you haven't said anything else at all about either
program, I'd have to say yes, absolutely meaningless.

~~~
tyn
Ok, let's say someone proposes you to maintain either A or B, giving you
10.000$ per year. You have the right to choose one of the two. He tells you
that the only info he can give you is the lines of code of each program.(think
of it as a thought experiment.) If you say, I don't care to know - it's
meaningless. you lose the chance to make 10.000$ per year by maintaining a toy
application of 20 lines. Even worse if you say, I just need the 10.000$ and
choose B randomly.

I mean, at least one info you get is that A is a toy application and B is a
big program. Might be big because it's full of useless sh*t, but still it's
big and this IS some information.

~~~
zepolen
Thought experiment eh?

Consider A == B without line breaks.

~~~
tyn
That was a good one. But somehow it supports my argument, showing that any
additional information (like how many of the lines are blank) brings some new
value.

------
axod
The best and most productive days are when you _remove_ hundreds of lines of
code.

~~~
mynameishere
Subject to simple disproof. Here follows the greatest possible program in the
universe:

~~~
axod
Best program = most functionality, in least lines of code. Yours fails on the
first measure.

~~~
mwei
I would disagree. Few lines of code means reduced readability - not good for
future development. There has to be balance.

~~~
axod
Of course. You don't take things to extremes. Add in "readable" into my
statement :)

------
ryanwaggoner
Just want to respectfully request everyone to calm just a tad...I'm well aware
of how bad a metric "lines of code" is, but I was still curious :-)

------
jcapote
I heard somewhere the industry average was around 10 to 15 lines a day...

------
jlouis
Optimize for lines of code not written! Good programmers can optimize this
metric by quite a lot -- hence LOC count means absolutely nothing.

It _is_ better to think for a long time about a problem and then only write
the 20 lines that solves it rather than throwing 300 lines at the problem and
still sit with a flaky solution. _insert rant about test-driven-design-
fanatism here_.

At the moment I am cranking negative lines of code count in the project I am
working on. The code is not that good and can be abstracted quite much, so I
am overall removing lines from the code via the rewrite.

Interestingly, there is also the quality of said cranked lines. It isn't good
when the lint tool finds problems or when the code produced just looks damn
ugly.

------
cperciva
It varies from day to day. Most days it is somewhere between -500 and 500.

The shortest time interval over which I produce remotely consistent results is
a month: Most months I produce -- that is, design, write, and debug -- between
1000 and 1500 lines of code.

------
bjclark
This question makes me giggle.

Who the fuck would care about how many LOC they write a day? I've never even
considered this.

Things I care about in my code (thanks Kent): Runs all the Tests? Reveals all
the intention? No duplication? Fewest number of classes or methods?

Although, I kinda of like this question. I'm going to add this my list of
questions to ask someone in an interview. Only cause I want to see how many
try to answer this with a straight face and how many people giggle.

------
jdavid
i think IDE has a big role in this,

with Visual Studio i feel so much more productive, but it also puts so much
information at my finger tips, and programing in C# or VB.net were really
pattern based.

programing raw javascript and dealing with DHTML with support for IE6/7,
Safari, Opera, and FF can really cut your productivity. Not only are you
looking up everything on the web when something breaks, but there are just so
many pieces to the puzzle that make good JavaScript hard. Thank you Douglas
Crockford for part one of making JS better, and thank you John Resig for
making the second part easier. Hopefully mozilla will be able to make a 3rd
part easier with their new tools R&D lab.

In PHP I generally felt really unproductive until I had zend and a debugable
server set up.

Closing that loop is hard, and I wish there was a better measure of
productivity than LOC.

------
mrlyc
LOC are not always accurate. I once rewrote 2,650 lines of C code as a seven
line shell script. The previous programming team had written a data transfer
program using their own implementation of ftp. I just used the one that was
already on the computer.

------
maxklein
Somewhere between 100 and 150. 10 fricking lines? Who produces just 10 lines?
Are you just looking at your monitor and day dreaming or what? I just wrote 5
lines of text right now in like 2 minutes.

~~~
icey
Yesterday I probably wrote 8 or 9 lines of code. That was all the problem at
hand required. However, getting to that 8 or 9 lines of code took hours of
conversation with various people as well as a few more hours of research,
fact-checking and bench-marking.

Last week I had a day where I probably generated 25,000 lines of code. The
generator probably took up 400 or so lines itself. Because I wrote the
generator, do I get to say that _I_ created the 25k lines?

The small amount of code I wrote yesterday was vastly more important that the
generated code I wrote last week. Which day was more valuable?

Lines of code is a worthless measure.

[Edited for tone]

------
PaulKeeble
A lump of bash(ish) scripts for doing auto deployment is after 9 weeks average
around 130 lines added a day and around 4 removed.

Interesting the peak is 1201 lines, and the lowest is 1.

------
known
Any good implementation of asoftware feature is inversely proportional to the
number of lines of code.

------
wlievens
Anywhere from -5000 to +5000, duh.

------
imasr
If you where about to meassure out your... Size. You'd do it in inches. Though
it will tell you nothing about performance, it'll still be a form of
meassurment. Let the man be proud of his size!

