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.
 

Related Whitepaper:

Software Architecture

This guide will introduce you to the world of Software Architecture!

This 162 page guide will cover topics within the field of software architecture including: software architecture as a solution balancing the concerns of different stakeholders, quality assurance, methods to describe and evaluate architectures, the influence of architecture on reuse, and the life cycle of a system and its architecture. This guide concludes with a comparison between the professions of software architect and software engineer.

Get it Now!  

One Response 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.

Leave a Reply


eight + = 13



Java Code Geeks and all content copyright © 2010-2014, Exelixis Media Ltd | Terms of Use | Privacy Policy
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.

Sign up for our Newsletter

20,709 insiders are already enjoying weekly updates and complimentary whitepapers! Join them now to gain exclusive access to the latest news in the Java world, as well as insights about Android, Scala, Groovy and other related technologies.

As an extra bonus, by joining you will get our brand new e-books, published by Java Code Geeks and their JCG partners for your reading pleasure! Enter your info and stay on top of things,

  • Fresh trends
  • Cases and examples
  • Research and insights
  • Two complimentary e-books