How Many Lines Of Code Do You Write Every Day?

I was recently asked a bizarre question in an interview – “how many lines of code do you write every day?”

I’ve been thinking about that question for a week and realized that it makes sense since she was a C person before migrating to other work a few years ago, not a contemporary java person.

To explain, I can fold my career into three major stages.

Ancient – computers were resource-limited (memory < 1 MB) and no third-party libraries to speak of. Our “internet” was journals (esp. “Programming Pearls”), magazines (e.g., “Dr. Dobbs”) and books. You wrote everything you used and you needed to use efficient algorithms and data structures if you didn’t want it to crawl. SLOC could be considered a fair measure of productivity, subject to various well-known limitations. (E.g., you needed to be comparing comparable work using the same definition of SLOC, etc.)

(Sidenote: on several occasions I improved performance of existing code by several orders of magnitude – literally hours to minutes or minutes to seconds – by simply recognizing that the code was now running on computers with more memory and I could cache values instead of constantly rereading files or the database, recomputing values, etc.)

Mature C – computers had decent resources (memory < 100 MB) and a wide variety of quality third-party libraries. We could get those libraries via the internet but it was years before Google or blogs and we still depended on journals, magazines and books. SLOC was starting to lose its value since you could have one person who still wrote everything himself (including bugs) and another person who took less time and wrote fewer SLOC but had better results since he used a third-party library. Knowing good third-party libraries was important but not critical and you still spent most of your time writing code (excluding meetings, etc.).

Mature Java – computers have ample resources (memory > 4 GB, multicore processors) and a number of quality deep libraries. The standard API, Apache, Spring Framework, etc. We can get libraries by adding a few lines of text to a configuration file and we can learn about them by reading blogs and Google searches. We’re often more productive with a day of research than a week of coding.

There is no “right answer” here since it depends on the ecosystem. Some languages have deeper third-party libraries than others. Some shops require highly specialized needs that they must write themselves. But it really struck me just how different my world has become over the last few years when she asked that question and my first thought was how much time I spent in research vs. coding and how that affects the raw SLOC numbers.
 

Do you want to know how to develop your skillset to become a Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you two of our best selling eBooks for FREE!

JPA Mini Book

Learn how to leverage the power of JPA in order to create robust and flexible Java applications. With this Mini Book, you will get introduced to JPA and smoothly transition to more advanced concepts.

JVM Troubleshooting Guide

The Java virtual machine is really the foundation of any Java EE platform. Learn how to master it with this advanced guide!

Given email address is already subscribed, thank you!
Oops. Something went wrong. Please try again later.
Please provide a valid email address.
Thank you, your sign-up request was successful! Please check your e-mail inbox.
Please complete the CAPTCHA.
Please fill in the required fields.

2 Responses to "How Many Lines Of Code Do You Write Every Day?"

  1. G.Arlington says:

    Lines of code metric was never useful, you could always write the same code in different number of lines and the efficiency and clarity of the code was always most important quality.

  2. Bobby says:

    I too was asked this question in a phone interview, and I objected to the question as ‘lines of code per day’ is a poor measure of a programmers ability.
    One of the highlights in my last job was spending two weeks investigating a performance bug. The result was changing two lines of code and a dramitic improvement in performance.

Leave a Reply


eight + = 14



Java Code Geeks and all content copyright © 2010-2014, Exelixis Media Ltd | Terms of Use | Privacy Policy | Contact
All trademarks and registered trademarks appearing on Java Code Geeks are the property of their respective owners.
Java is a trademark or registered trademark of Oracle Corporation in the United States and other countries.
Java Code Geeks is not connected to Oracle Corporation and is not sponsored by Oracle Corporation.
Do you want to know how to develop your skillset and become a ...
Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you two of our best selling eBooks for FREE!

Get ready to Rock!
You can download the complementary eBooks using the links below:
Close