13 points · by ryanwaggoner · 18y ago · 33 comments
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 :-)
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.
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.
I've had days where I was writing mindless interface code and banged out a couple thousand lines in a day. The hacks I'm really proud of are the ones that are 300 lines of code that took me two weeks. It's figuring out what those 300 lines should be that was the interesting part.
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.
and complexity hits you in maintability, growth, performance, and ultimately cost.
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.
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.
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.
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.
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]
If you normally write 100 lines/day, but spend 90% of your days in meetings, rehashing old design decisions, tracking down bugs in vendor's code, debugging that NullPointerException your coworker introduced, and writing tests to ensure it never happens again (or worse, writing memos to pretend it'll never happen again), I could easily see how that'd drop to 10 lines/day. And I don't think that's an inaccurate description of the corporate development process: even in a startup, working with a team of 4 people, I spent more time than I would've liked on the above activities.
Doesn't seem like much of a comparison. Sure, I could write hundreds of lines of code in a few hours (or thousands of lines of text) if my goal was to produce volume. But if my goal is to improve a complex program, it might take 8 hours to complete a 10 LOC change.
Interesting the peak is 1201 lines, and the lowest is 1.