Original question from Quora:

How many lines of code do professional programmers write per hour?

My Answer:

The answer to this question is surprising because you would imagine the number to be high and perhaps the better the programmer the number to be even higher…

I’ve been writing code for a living for the last decade and I’ve been writing code for fun another ten years before that. Twenty years of doing something will teach you a lot.

Here is the thing about writing code…

The amount of code you write doesn’t have a whole lot to do with what you build or how long it takes.

In fact, you can spend an inordinate amount of time working on a problem or a project without writing any code at all. Seems strange doesn’t it?

Programming is a creative pursuit. It’s like painting or sculpture. You don’t judge an artist by how many brushstrokes they take or how many times the pot spun around before it was molded to a perfect shape.

No, it is quite different than that.

Solving a problem is 80% thinking and 20% doing and the thinking is often more important than the doing. In the world of code it can be more extreme than that.

Over the years, I’ve moved into senior and architect level positions where I’m thinking about ever larger and harder problems on incredibly complex systems. Each year I find myself writing less code and thinking more often. Each year I find myself spending more time reviewing the code of others than creating the code myself.

When I do sit down to create something new, that is when I get to really write a lot of code, but only because I’m creating something new that never existed before. That takes some code.

But a funny thing starts to happen. There is an initial burst of energy about a project where a lot of code happens quickly. This is regardless of how professional the programmer is.

Over time, the amount of code added goes down, until the only changes become small 3–5 line fixes, not 500 line additions. It’s a known phenomenon and it seems to happen in every project.

So really, there is no good answer to your question because it’s a question that lacks the understanding of reality.

Programming isn’t about writing code, it’s about solving problems. Writing code is the smallest and often least important part of software development.

How much code you crank out per hour says almost nothing about anything unfortunately.

-Brian

P.S. Have you subscribed to Code Career Genius yet?