Ask HN: How many Lines of Code do You Write Every Day?

Just wondering how productive my fellow programmers are. yesterday I spent 13 hours coding and someone at the end of the day, after writing, testing, re-factoring, deleting and re-writings chunks of code, I realized i only wrote about 800+ lines, which is pretty sad.

Any tips on how to increase productivity would be appreciated too.

  • I only wrote 2500 LOC yesterday, I was disappointed in myself. Normally I do at least 4000.

    Also, my dad is 12 feet tall and he can beat up your dad.

    In all seriousness, LOC will always be an almost-meaningless metric.

    Sustainable productivity comes from good teams working on products that have user/customer feedback early on, and which actually solve someone's problem (a tractable one) in a reasonable way.

  • Being a productive coder has nothing to do with the amount of lines you write.

    Don't focus on this.

  • This question has been asked many times before, but to summarize my past answers briefly: It depends on what sort of code I'm writing (http://news.ycombinator.com/item?id=36784), but my long-term average is about 1000 LOC/month (http://news.ycombinator.com/item?id=105410).

  • "Measuring programming progress by lines of code is like measuring aircraft building progress by weight." - Bill Gates

    I truly don't understand why counting LOC is some sort of badge of accomplishment. I think once you've coded enough you'll realize that efficiency matters most. Efficiency and elegance is what I aim for.

  • http://www.folklore.org/StoryView.py?project=Macintosh&s...

    Or, if you prefer Dijkstra:

    "In this respect a program is like a poem: you cannot write a poem without writing it. Yet people talk about programming as if it were a production process and measure 'programmer productivity' in terms of 'number of lines of code produced'. In so doing they book that number on the wrong side of the ledger: We should always refer to 'the number of lines of code spent'."

  • I've never counted. But I'd guess not more than 300 or 400, and by the end of the week, if I've been thinking clearly, I'll have shaved the code written down to less than that. Probably my most productive week ever ended with ripping almost all of my code out, and replacing it with an SQLite module from CPAN. The program went from a few thousand lines to about 500, making the software O(1), instead of O(n^2) or something worse.

  • (I don't mean to disparage your coding ability or Prolog). If you have written 800 lines of ruby, you have earned yourself a 6-pack beer, go chill! If it was 800 lines of Prolog, go buy a bottle of Nyquil - you need to rest your mind and body!