Monday, March 5, 2018

COBOL and My Grandfather

OK, so this is not really about my grandfather and whether I am or am not actually turning into him.  In honesty, it's not really possible to speak coherently about either of my grandfathers, since one passed away almost thirty years before I was born, and the other when I was ten, so I don't really have memories to share.

It is about computer programming, of the kind that people used to do in the bad, old days of English-like languages, the ones that were created in the 1950s and 1960s to tell computers what to do.  And, apparently, grandfathers.

I was laughing at myself to my best girl the other day, which I'll get to at the end of this piece.  It actually had to do with programming.

In 1968, I was a summer student at a program where high-school students heading to their senior year could spend a couple months taking college classes on campus.  That's where I first realized that I readily understood what an "algorithm" was, and that I might want to program for a living because I had a knack for it.

Algorithms, then and now, are simply series of steps you tell a computer to take such that, if you tell them properly, they will do something with the data you give them to compute some kind of output you're looking for.  Back then, you would write the algorithms up as a "program", using a language like FORTRAN or COBOL (that summer class taught FORTRAN) with a certain syntax that included "routines" (smaller series of steps).

Trust me, I'm making this simple to make the point.

COBOL was more attuned to business and accounting than the more math-based FORTRAN.  The steps were organized into paragraphs, which had a paragraph title (usually full of hyphens) so it could be referenced.  A "routine" or "subroutine" would be referenced by telling the computer to start with the first paragraph of the routine.  In COBOL, that statement might be something like "PERFORM CALCULATE-ROUTINE".

When I was about 25, I actually did start programming for a living, for the old Burroughs Corporation in Boston.  I would only be an actual "programmer", as in that being my actual main task, for a few more years.  But I would write code, either as part of my job or as a consultant, for over twenty-five years.

Now, programs for a new requirement typically involved lots of routines that had been written for other programs many times before.  So programmers would develop reusable code that we would just slap into new programs, rather than reinventing the wheel. 

One such reusable chunk of code was called "JU", a series of COBOL paragraphs comprising a routine to do Julian date conversions.

Julian dates, of course, reflect the old Julian calendar somehow.  They are simply a mathematical expression of a date that is the two-digit year followed by the three-digit day of the year.  January 1st, 1985 would be 85001 in Julian, while December 31st, 1993 would be 93365.  Why did you need this?  In those days before Excel, Julian dates made it much easier to compute the number of days between two dates.  You would "send" the date to the JU routine and it would convert it and "send" it back, then your code would be able to do some kind of math computation.

I must have written the code instruction "PERFORM JU" a hundred times in a hundred different programs, all with the same code cut and pasted into a new program.  Of course, Julian date usage died when we entered the Y2K crisis in the late 1990s and we had to worry about four-digit years, but by then more contemporary languages, ones that did that sort of date-handling for you, had displaced COBOL and FORTRAN.

So last Wednesday, something reminded me of Julian dates for some reason.  Having not thought of "JU" or COBOL or any other programming in a long time, I started telling the missus about Julian dates and that today's programmers, of which I am decidedly not one, wouldn't know what I was talking about.  Their modern languages do all that stuff for them, all in the background.

As I was talking, I realized that I was ridiculing today's programmers for not really "understanding" what they were doing, or what their languages were really doing in the background.  And it struck me that I was saying that what I had had to do, 40 years ago, to write a program was somehow better than what the young Turks do these days -- much like my grandfather might have told me about having to walk two miles through snow drifts to get to school, in hand-me-down boots.

I had become my grandfather.  I had looked at the next couple generations after me and was contemptuous of how easy they seemed to have it.  Of course that was all about programming, and not walking through snow to get to school, but you get the idea.  It's bigger than that; it's how the elders of a generation look at those after them; I'm sure that 60-year-old Romans in 50 B.C. did the same thing, in some way in looking at the whippersnappers of the era.

So I laughed at myself.  And naturally, my best girl laughed more at me than with me.

Copyright 2018 by Robert Sutton
Like what you read here?  There's a new post from Bob at at 10am Eastern time, every weekday, giving new meaning to "prolific essayist."  Appearance, advertising, sponsorship and interview inquiries cheerfully welcomed at or on Twitter at @rmosutton.

No comments:

Post a Comment