Friday, January 04, 2013

More linguistic maundering

kw: programming, languages

I sometimes joke that I've written a mile of computer code in my career. Someone challenged that, so I decided to figure it out. To avoid being too nit-picky, I'll mostly confine myself to the period during which I programmed all day, every day, and sometimes into the night like any good hacker (when "hacker" was an honorable term).

Definitions and standards:
  • A "line" takes up 1/6 inch on a line printer listing (what else would a programmer print on?).
  • One foot of printout (ignore margins) contains 72 lines; one mile is 72x5,280 = 380,160 lines. That is my goal.
  • There are 260 weekdays per year, but we must subtract 10 holidays and 10 days of vacation, and also allow 10% of the rest for meetings and administrivia. The balance is 215 productive days per year.

I learned FORTRAN II early in 1968. I was soon doing nothing but writing programs, doing my own card punching. I typed slowly in that period, but I could produce about 20 code lines daily. In FORTRAN, using cards, that means an average of about 30 characters. "Lines" include comment lines that consist of more than the comment character. This continued until very late in 1970, so let's consider it to be 2.5 work years. 215 days times 20 lines is 4,300 lines per year, or 10,750 lines. The machines I used were an IBM 1130, a CDC 3100, and a Xerox Sigma 7. During this period I was sent to a class to learn the "executive system" (an early version of OS360) and FAP, an assembly programming language that worked with FORTRAN II. I wrote too little FAP to count.

I did a little programming here and there in the next few years, while finishing a BS degree, but not enough to count. My next heavy programming gig began in 1975, and lasted 3 years. I improved both my thinking and my typing, with the help of a good mentor, and my production was 30 usable lines of FORTRAN IV daily, on a CDC 3600. No card punch now, but terminal input. 3x215x30 = 19,350 lines. Total to this point: 30,100.

I started graduate school and, while studying engineering, worked for the computer science department, first tutoring and then teaching, starting at the beginning of 1979. This lasted five years. The first summer I worked hard on my touch typing, getting my speed up to 50 wpm. My programming rate also went from 40 lines/day in 1979 to an average 75 lines/day thereafter, when I was writing FORTRAN (IV and then 77). This was in addition to full time class work! My wife sometimes called herself a "computer widow". This was all on small CDC Cyber machines, 720, 825 and 835. One year at 40 lpd = 8,600 lines; 4y at 75 lpd = 64,500 lines. Total: 94,600. That's a quarter mile, minus 440 lines.

At the beginning of the next period I learned the COMPASS assembly languages; there are two, one for the CPU and another for PPU's the peripheral processors. I became a system analyst at the university while finishing my engineering degree. For the following three years I wrote 1/3 FORTRAN 77 and 2/3 CPU COMPASS, but very little PPU COMPASS. Assembly languages are harder and require more think time. My COMPASS productivity did not exceed 50 lpd. Thus I wrote about 16,125 lines of FORTRAN 77 and about 21,500 lines of COMPASS, a total of 37,625 lines for a total of 132,225. It's just past 1/3 mile…

I got work at an oil company in 1986 as a systems analyst. I wrote only COMPASS for the first year: 16,125 lines. The machine was a CYBER 860. Then I wrote mostly FORTRAN 77 on DEC VAXes for a few "skunk works" programming groups until mid 1995. Here I hit my stride, averaging 100 lines per day, but now I'd worked long enough to have another week of vacation each year, so there were about 210 days in those work years. It comes to 7.5 years, or 157,500 lines. Total: 289,725 lines or a little over 3/4 mile.

I am closing in on the goal, but there is little programming left. I transferred to the parent company in Delaware, where I now work (and will retire in a few weeks). They needed me to lead a database project. I used FORTRAN in a more ancillary mode, for no more than a quarter of my time for the next four years. Lines produced: 21,000 for a total of 310,725.

The company quite using FORTRAN altogether in 2000. I learned Perl with the help of a colleague (who is presently my supervisor). Since that time I have written very little, all in Perl, not for web pages but for file conversion and text processing. It totals no more than another half year out of the past 12 years, or at best, 9,500 lines, since I am a little slower in Perl than in FORTRAN (I have to look stuff up).

Thus my lifetime total is about 320,000 lines, maybe a little more, in all languages I have used. I suppose I could add in a little VBA for a couple of Excel macros I wrote as Functions, but let's ignore that, and conclude that I didn't quite make my mile. It totals 0.84 mile of code, if printed out at 6 lines per inch. But, hey, this is a metric world: I comes to 1.36 km!

The average "line" is about 30 characters. 9.6 million characters, or less than 10 MBytes, represents about 22.5 years of full time computer programming! (over a 40-yar span) In space taken, it is equal to three JPEG files from my digital camera. Sic transit gloria mundi! On the other hand, those programs kept a lot of scientists very busy for decades.

No comments: