Jeff's Blog

Musings about software development, Java, OO, agile, life, whatever.


Sunday, February 04, 2007 
Origins 2

(continued from Origins)

My next relevant computer experiences were in high school. We had an HP/3000 computer, a friendly, stack-based minicomputer. An anonymous donor had supplied our school with the machine and a number of terminals. The students quickly ended up its masters, knowing far more than the operator paid to do the job. I spent a lot of time outside class mucking around with the HP.

The donated HP2640 terminals had screen memory. You could page up to review prior screens, a radical notion at the time. You could even add memory cards, boosting available paging to as many as ten screens! Or, sadly, you could remove memory, which our benefactor apparently did, stripping things down to a maximum of 17 lines. Instead of the standard 25x80, we had 17 lines in which to work.

Seventeen lines isn't much. Worse, we only had a line editor (similar to edlin, but much more functional). That meant the latest command prompt itself was one of those 17 lines, so we really only had 16 lines available to list code. It also meant you had to do quick mental math to come up with a command that listed the appropriate lines, such as L 12/27.

What a nuisance! But looking back, being forced into this constrained environment taught me to construct small functions. That's something I still find to be one of the most valuable base constructs in programming today (see Small Methods). Functions longer than 16 lines created comprehension headaches, since there was no quick way to scan the entire function at once. Longer routines required at least two list commands, and that's only if you got the line numbers right.

As an aside, I'm sure programmers killed many more trees than necessary because of the other solution, which was to print out the code. I know people who struggled for years to move away from printouts as their primary mechanism for understanding a program.


Comments: Post a Comment

Links to this post:

Create a Link



<< Home

RSS Feed (XML)

Archives

February 2004   March 2004   May 2004   September 2004   October 2004   January 2005   February 2005   September 2005   October 2005   November 2005   December 2005   January 2006   February 2006   March 2006   June 2006   August 2006   January 2007   February 2007   March 2007   April 2007   September 2007   October 2007   November 2007   December 2007   January 2008  

This page is powered by Blogger. Isn't yours?