7 ms·
Ask HN: How many lines of code do you deliver every day?
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.
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 :-)
- bompakiler007 18y agowww.netlog.com/fashiionstylezZ_
- bompakiler007 18y agonetlog
- bompakiler007 18y agonetlog.com
- bompakiler007 18y agoNETLOG
- bompakiler007 18y agonetlog
- cperciva 18y agoIt 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.
- jcapote 18y agoI heard somewhere the industry average was around 10 to 15 lines a day...
- nostrademons 18y agoIt'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 18y agoPlease 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.
- mixmax 18y agoI absolutely agree. The problem is that unless you have a one man project without a deadline you need some kind of count. And LOC seems to be the best there is.
- DanielBMarkham 18y agoMight want to try team velocity, at least if you're on an agile project. That seems to be a nice balance between the need for metrics and the reality of technology solutions.
- wheels 18y agoAll lines are not created equal.
- deleted 18y ago[deleted]
- deleted 18y ago[deleted]
- wheels 18y agoHere's the way to phrase it, "How much of your day can you spend working on your projects?" That's the difference, seemingly, at a startup. 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.
- jlouis 18y agoOptimize 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.
- maxklein 18y agoSomewhere 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.
- nostrademons 18y agoAFAIK the 10 lines/day figure is a long-term average for tested, debugged code in large organizations. 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.
- icey 18y agoYesterday 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]
- jon_dahl 18y agoI just wrote 5 lines of text right now in like 2 minutes. 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.
- axod 18y agoThe best and most productive days are when you remove hundreds of lines of code.
- mynameishere 18y agoSubject to simple disproof. Here follows the greatest possible program in the universe:
- axod 18y agoBest program = most functionality, in least lines of code. Yours fails on the first measure.
- jdavid 18y agoI think LOC is a better measure of complexity than productivity. and complexity hits you in maintability, growth, performance, and ultimately cost.
- ryanwaggoner 18y agoJust 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 :-)
- imasr 18y agoIf 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!
- jdavid 18y agoi 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.
- bjclark 18y agoThis 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.
- wlievens 18y agoAnywhere from -5000 to +5000, duh.
- mrlyc 18y agoLOC 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.
- known 18y agoAny good implementation of asoftware feature is inversely proportional to the number of lines of code.
- PaulKeeble 18y agoA 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.