[PLUG] The joy of refactoring

Alan alan at clueserver.org
Wed Aug 23 17:17:54 UTC 2017


On Wed, 2017-08-23 at 06:01 -0700, Rich Shepard wrote:
> On Tue, 22 Aug 2017, Alan wrote:
> 
> > Sometimes a rewrite is a useful and needed thing.
> 
>    Thanks, Alan, for allowing us to share our obscure bug experiences
> on this
> thread. :-)
> 
>    In grad school in 1972 I wrote an ecosystem ecological energy flow
> model
> in FORTRAN IV to run on the U. of Illinois' IBM S/360. It used more
> than a
> whole box of 80-column Hollerith cards for input. When it ran it
> produed
> incorrect results, but only the same 2 or 3 wrong answers each time.
> So I
> printed the source code listing on the wide green-bar paper that all
> the
> line printers used. The output was about 1 inch thick.
> 
>    I carefully examined each line of code multiple times without
> seeing the
> error. Finally, I took the printed listing to the computer center's
> help
> desk. They examined it without finding the problem.
> 
>    One day, strictly by chance while looking at a new printed copy
> (likely
> done on a printer with a newer ribbon) I saw the error jump up and
> bite me
> on the nose.
> 
>    Instead of a loop index written as FOR I = 1 TO N I had mistyped
> it as FOR
> 1 = 1 TO N. Distinguishing 1 from the uppercase I was difficult and,
> because
> all of us expected to see I and not 1 in that position we all
> overlooked it.
> 
>    Haven't forgotten this after all these years.
> 

That is one of the first lessons you learn if you learned to type on a
Royal manual typewriter. Looking for 0 and O is another.

I remember the days of Fortran and punch cards. I still remember how to
make Lace Cards.




More information about the PLUG mailing list