How many lines of computer code have you written in your lifetime?


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Started from the Commodore 64

Anonymous's picture

wrote an address book on the amiga as well as some games. Graduated to the pc and wrote a lotto program with more than 20,000 LOC then did some university projects each using about 10,000 lines of code. Wrote a fast food staff planner and shift manager that ran to over 2 million lines of code. Assembly and C code. Did it all myself in 3 years. Introduced it to managers of the company and trained them. Since then wrote a game with 500,000 LOC and now working on a lotto program to manage your lotto portfolio and pick numbers that have statistically more chances of winning. so far has 1.5 million lines of code and counting.

What languages do you use?

Anonymous's picture

What languages do you use? Cos i believe your LOC is quite exorbitant for those programs

I've got a better one: how

Anonymous's picture

I've got a better one: how many coding styles have u used?

One. Because I'm just that

CarrotRevelations's picture

One. Because I'm just that good and I don't use \n. ;)

Another guess...

smotsie's picture

...but I wrote three separate versions of a 10kLOC web-based program a few years ago and I've lost count of the bash scripting I have done, so my guess is probably in the right ball-park.

Do we get brownie points for the more lines we've written? (or should we get extra for being really efficient in our programming?)

Also, I think 25 lines of fully debugged code a day sounds about right if you are doing the design, test, debug all yourself.


What is code?

David Lane's picture

An interesting survey, but just what is considered code? Is it writing code to write HTML pages by hand? Is it writing code to write shell scripts? One would hardly argue that writing something in C, Fortran, or Cobol is writing code but what about BASH, JavaScript or Perl?

It used to be a joke that if I was writing code, there were bigger problems that had to be addressed. After all, I am not a programmer nor have I ever played one on TV. With that being said, I have written a number of "programs" in perl to crunch data, in both PLSQL and SQL to extract data, scribbled up some shell scripts to make my life easier, and yes, created a lot of HTML pages, from scratch with a lot of angle brackets and other goofy syntax.

Is that code?

David Lane, KG4GIY is a member of Linux Journal's Editorial Advisory Panel and the Control Op for Linux Journal's Virtual Ham Shack

Just taking the cue...

El Perro Loco's picture

...from Dave's comment above:

I have been asked in some job interviews "how many lines of SQL code I have written" and, most of the times, I found that to be irrelevant. There are many, many tools to "compose" SQL statements/queries/"programs" - and then, how to count the lines of output towards my "total"?

So, yeah, why would it matter - especially nowadays - how many lines of code one wrote, right?

Lines of programming code

benny's picture

Actually tried to calculate this a few times the last few years. Started programming in 1960 on what were called Electric Accounting Machines (EAM). We used wires that plugged into holes in those days. Some of those machines were the IBM 407 (printer), 604 (calculator) and 101 (statistical sorter). The the IBM 1401 came out which used the Hollerith cards for input and a programming language called "autocoder". Was more of a computer operator from 1960 to 1962 doing code when my manager would permit it. In 1962 I became a full time programmer. Autocoder is similar to today's assembler but was written for machines that used "word marks" to define where instructions started. It was a different world as far as computer knowledge goes. COBOL was also available about that time but didn't use it often as the compilers were slow and so was the generated code. I'm not going to give my history as it is now over 50 years. The majority of that time I was a programmer but also spent time as a systems analyst, tech support manager and finally systems programmer. The mid 1970s were my favourite years where I was just cutting code (mainframe 360 assembler) based on flow charts. Didn't have to think as the systems analyst did that for me. Only had to sort out the best way to code the logic that was in the flow charts. No stress in those days and it was my most prolific time at cutting code. There were no keyboards for us so we wrote the code on pre-formatted paper which was given to a group of keypunchers (usually young females) and we often got the punched cards back within a couple days if it was urgent. Of course, these girls also were key punching the data to be input to the company's production systems. So it had high priority. My highest output for a day was about 3000 lines, average of about 5 lines per minute for 10 hours. Those cards were then put into a container, often the 2000 card box they came in, or if only a small program, would just put a couple lacky bands round them. They also had to have JCL wrapped with them so the computer would know what to do with them. The bundle was put in a hatch next to the computer room where it would usually be run overnight. The first run often had JCL just to either produce a listing or do a compile. Hours were spent "desk editing" the results. Many an hour was spent at Bondi Beach looking at the listings to ensure it was what was intended. This was way before a first test.

So times have changed and I now program mainly in Python and for myself, although I have contributed some C++ code to Linux apps. Over the years I've used so many languages and on so many architectures, like the RCA 501, Honeywell 100, ICL, Commodore 64 and Amiga. But most of the time it was on IBM mainframes with the 360, 370, 390 architecture and mostly in assembler. Retired the end of 2002, after 43 years but haven't stopped programming. Have written seven 2000 line Python scripts the last year, plus lots of little ones, mainly plasmoids. So my coding rate is down. I also debug them interactively now. Think I was lucky to get into computing when I did as have gone through so many generations of change and it has been very interesting.


More Than We Think

obx_ruckle's picture

Perhaps most of us have written more code than we think.

I remember the punch card and having to budget computer lab time in the 60s and then after thinking about the original question I realized it is "How many lines of computer code . . ." not just programming code. If you include just my html code which is written on a computer to be read on another computer I've done more than 102,775 with just one web site I administer.

So perhaps I'm pushing the 999,999 limit or even in the 1,000,000+ class as I'm sure others with more experience than I would be.

Programming since 1966

zygmunt's picture

Programming since 1966 Assemblers, Atlas Basic Language, Fortrans, Algol, PL1, Occam, Smalltalk,...., C, java, graphics+maths, you name it. Not many constructs to learn througout. Difficult to distinguish what to include as "code". 40+ years of code and still at it from time to time. Once "cobbled together" 30,000 LOC in a week..Worked as well..testing was minimal of course for that specific use of the code. Just enough graphics to see the results looked reasonable in the one off project.


smpratz's picture

Can I count all the BASIC I typed from Compute! magazine listings? Nah, I didn't think so.

Less than a thousand, then.

Rate * time = distance

SnoopDougieDoug's picture

Whew, that higher math is a killer.

Seriously, 100KLOC is not that much/work day if you have 20+ years experience. Roughly:

100,000 / 20 years is only 5KLOC/year
5,000 / 200 work days/year is only 25LOC/day.

25LOC/day isn't that much.

So take that you yutes!

Would You Believe FORTRAN IV?

waparmley's picture

A long, long time ago I used FORTRAN IV, and a long time ago I wrote Windows utilities for myself and friends using QuickBasic (the version that would produce compiled .exe files). Both were self-taught. Then I picked up a couple of books with the intent of teaching myself C. Didn't take long for the luster to wear off that idea! Then I decided to try Visual Basic. Same result. I finally decided that I could do anything that I really needed to do with a spreadsheet.


I have the greatest of respect for coders -- I lack the patience, motivation, and most of all, talent to do that job.

Would you believe Fortran II

Anonymous's picture

It's true. My first programming language was Fortran II, running on an IBM 1620. After that, a few thousand lines of code as an undergraduate writing an ECAP clone in Fortran IV for the IBM 1130, followed by a stint as an intern writing power system analysis programs, also for the IBM 1130. Got pulled into the military, where my computer expertise was used to paint the cable trays around a Univac 1108. Back to serious work later in the 70s, mainly Basic, 6502 (used as our microcontroller of choice) and Nova assembler, and of course, Fortran, this time for PDP-11 and LSI-11 systems. Major achievement was a 600 line Fortran diagnostic and data acquisition program, written the night before it was needed. Last major programming effort was a 5000 line Pascal program used for PDP-11 based test system diagnostics, written on a VAX. These days, mainly fairly small scripts to munge data, followed by import into a spreadsheet. Oh well.


metalx2000's picture

I wonder how many times I've type "#!/bin/bash" in my life.
Everything you ever need to know about Free Software.


corfy's picture

I took three programming classes in college and wrote several lines of code for them (along with a few programs I wrote on the side). While I'm pretty sure my total is over 1,000, I can guarantee it is less than 10,000. Unfortunately, that was with a programming language that isn't used much outside of the classroom (Pascal), and I didn't have my own computer at the time. By the time I got a computer, I had already forgotten most of what I knew (and now that it has been 15 years since I took a class, it is even worse). I do still play with a Connect 4 program I wrote for class. Unfortunately, I only have the binary. The floppy with the source code deteriorated.

I want to re-learn programming, but I haven't had the time to teach myself (and I don't know what to start with... C, C++, PHP, Java, or something else).

But I couldn't write a "Hello World" program from scratch in any programming language if my life depended on it (at least, not without doing a Google search first).

Laugh at life or life will laugh at you.


Richard Heck's picture

Anyone nowadays who asks me about a language to start with gets the same answer: Python. It's clean, it's object-oriented, and it's interpreted, which makes it easy to play with. And there are a gazillion good intros to Python out there. Go to the computer section of any decent bookstore and grab one. Since you've done some programming, even if a while ago, you might just start with O'Reilly's "Programming Python", which won't try to explain to you what a for loop is.

I would really like to see

Anonymous's picture

I would really like to see proof for those people who do more than 200klocs in a lifetime.

Cocomo II KLOC Estimation Tool

I've been using the Cocomo 2 algorithm during my latest project to see how well of an estimation it can give and I think it could be up to two times off. It could be that this work estimation algorithm is from the 80s?

200k Easily.

Rob Hooft's picture

200k in a lifetime is easy.

In the late 1980s I wrote a 30kLOC Pascal program to run my uncle's cheeseshop.

I worked with a professor that by far has not finished his career and that maintains the 300kLOC "WHAT IF" program that he wrote from scratch in Fortran. After 4 years working on that package in the 1990s without growing it significantly, "cvs annotate" gave me credit for 100kLOC.

If you check the news log of one program suite I wrote for my previous employer (on my own), you can see that it contains 80kLOC, most of which was done in 5 years. And I wrote other software to the side in those same years.

That makes 210kLOC for me in three packages, not counting all the other fun stuff I did on the side, before, or after. A rough overview? TRS80 Model 1 games, CP/M 3.0 extensions, WordStar 3 display drivers, VAX VMS System control programs, hardware drivers for the Linux kernel, some statistical tools, a Wikipedia bot framework, molecular simulation stuff, and all the tools/hacks that make my own life more fun without ever being of any use to anyone else.

considering one project

Anonymous's picture

Considering a single recent project I worked on had nearly 10,000, I estimated 1,000,000+ because I've been writing code for nearly 10 years.

lines of code?

obx_ruckle's picture

I guess I could have keep count but did not know there was going to be a test.

I have no idea

Luis Arce's picture

I began programing when I was 15 , now I'm 42.
Maybe if I have thought of it when I started I should have an account or at least an estimate.



Jerry McBride's picture

I just guessed... but it would be an resting project to catalog everything... Perhaps when I retire... :')

---- Jerry McBride

Bellissimo blog

Marco69's picture

Questo si ragazzi che è un sito veramente di successo complimenti

I wouldn't even know how to

War-N's picture

I wouldn't even know how to estimate 15 years of code, scattered around the planet.