The question of how many lines of code that you can write in a lifetime is really interesting. In many ways it is really kind of an odd question.

There Is A Big Range Of Answers

I’m going to put the number at somewhere between zero and nearly infinity.

Zero is obvious right? You could simply never write any code in your lifetime, and well ta-da! No code written.

Something like 99% of humans already write zero lines of code in their lifetime, so I believe it is a highly achievable number.

There Are Two Likely Numbers That Come After Zero…

The first possibility you can figure out by taking your average number of lines of code per day and multiplying it out to the number of days a year you write code times the number of years left you will be writing code.

I’m sure the number is something like 10 to 50 lines of code four days a week, fifty weeks a year for something like 10–40 years.

So maybe 20,000 - 500,000 lines of code left in your lifetime.

Now, There Is A Third Number That Is Possible, And It’s The Most Fun…

If you wanted to “win” the silly numbers game here, you’d write a program that simply wrote code for you via some vaguely useless code generation algorithm.

If done correctly your code would compile and run while growing at the speed of X lines per hour times Y hours running your program. If the program ran long enough your total lines of code would approach infinity when the generated code consumes all the computer storage in the known universe…

So, like I said, somewhere between zero and nearly infinity seems like the most correct answer I can give you.

In practical terms, it will probably be something much less than infinity and much greater than zero.