Re: [PLUG] The joy of refactoring

2017-08-23 Thread Dave
Sounds like a winner, Alan. Your Mother was very smart. Any student 
placed in a computer lab will either be turned on forever or quickly 
flee. The appeal of the card punch card machines, and their noise, 
followed by waiting for the computer to return a printout on the big 
line printer or slow TTY machine was magic.

My native tongue is also Fortran. Followed by BASIC which I dearly love. 
I wrote dozens of books on BASIC with translations into a dozen foreign 
languages. One of them was the classic _THE BASIC HANDBOOK, Encyclopedia 
of the BASIC Computer Language_. Hated to see BASIC disappear since 
*WHEN USED **FOR WHAT IT WAS INTENDED* it took absolute beginners from 
nothing to having fun and success on the first day. But with enough 
horsepower to carry them much further as desired. And those who wanted 
more could make the easy jump to the higher power but more cryptic 
language of the day.

Professors Kemeny and Kurtz did a good job creating BASIC and tens of 
millions of students were introduced to computers via derivative 
versions over the years. Most of them didn't go in computers of course 
but all gained a serious appreciation for what computers are all about. 
My Dentist today speaks glowingly of the time he spent in HS with BASIC, 
and even remembers some of it. -Dave.


On 8/23/2017 5:13 PM, Alan wrote:
> On Wed, 2017-08-23 at 10:30 -0700, Dave wrote:
>> In 1969-70 I was at the U of Ills where I met a DEC PDP-8. Would
>> change
>> my career path.
>>
>> Ran my Doctoral Dissertation data analyses on an IBM 360/40 in 1970
>> at
>> Cal Poly SLO. Fun days.
> When I moved to Alaska I had been going to a private school. My reading
> skills were very good, but my math skills we not. My mother hired a
> math tutor for me from the University of Alaska. She figured the best
> method to get me interested in math was by teaching me Fortran. I was
> in 4th grade at the time. Spent a lot of time in the computer lab from
> then on.
>
>>
>> On 8/23/2017 6:01 AM, 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.
>>>
>>> Rich
>>> ___
>>> PLUG mailing list
>>> PLUG@lists.pdxlinux.org
>>> http://lists.pdxlinux.org/mailman/listinfo/plug
>> ___
>> PLUG mailing list
>> PLUG@lists.pdxlinux.org
>> http://lists.pdxlinux.org/mailman/listinfo/plug
> ___
> PLUG mailing list
> PLUG@lists.pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug

___
PLUG mailing list
PLUG@lists.pdxlinux.org
http://lists.pdxlinux.org/mailman/listinfo/plug


Re: [PLUG] The joy of refactoring

2017-08-23 Thread Alan
On Wed, 2017-08-23 at 10:30 -0700, Dave wrote:
> In 1969-70 I was at the U of Ills where I met a DEC PDP-8. Would
> change 
> my career path.
> 
> Ran my Doctoral Dissertation data analyses on an IBM 360/40 in 1970
> at 
> Cal Poly SLO. Fun days.

When I moved to Alaska I had been going to a private school. My reading
skills were very good, but my math skills we not. My mother hired a
math tutor for me from the University of Alaska. She figured the best
method to get me interested in math was by teaching me Fortran. I was
in 4th grade at the time. Spent a lot of time in the computer lab from
then on.

> 
> 
> On 8/23/2017 6:01 AM, 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.
> > 
> > Rich
> > ___
> > PLUG mailing list
> > PLUG@lists.pdxlinux.org
> > http://lists.pdxlinux.org/mailman/listinfo/plug
> 
> ___
> PLUG mailing list
> PLUG@lists.pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug
___
PLUG mailing list
PLUG@lists.pdxlinux.org
http://lists.pdxlinux.org/mailman/listinfo/plug


Re: [PLUG] The joy of refactoring

2017-08-23 Thread Paul Heinlein

On Wed, 23 Aug 2017, Tom wrote:


Yes, Perl is fun:
* I do not recognize any Perl code I wrote more than about year ago
  - despite all the evidence at hand


Having been down that particular road too often, I now try Really Hard 
to write comments before coding. I fail at this frequently, but I'm 
always delighted when I succeed. I maintain a Perl script that 
analyzes my current portfolio, with data held in a YAML file, and my 
last couple editing sessions have been very smooth thanks to that 
approach.


Also, some great advice I once read about commenting: Document the 
data, not the process, unless the latter is very obscure or 
ungoogleable.


--
Paul Heinlein
heinl...@madboa.com
45°38' N, 122°6' W___
PLUG mailing list
PLUG@lists.pdxlinux.org
http://lists.pdxlinux.org/mailman/listinfo/plug


Re: [PLUG] The joy of refactoring

2017-08-23 Thread Rich Shepard
On Wed, 23 Aug 2017, Alan wrote:

> 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.

   Yeah, I had those, too. The cards were created on the 029 keypunch
(kachunk, kachunk, kachunk).

Rich
___
PLUG mailing list
PLUG@lists.pdxlinux.org
http://lists.pdxlinux.org/mailman/listinfo/plug


Re: [PLUG] The joy of refactoring

2017-08-23 Thread Dave
In 1969-70 I was at the U of Ills where I met a DEC PDP-8. Would change 
my career path.

Ran my Doctoral Dissertation data analyses on an IBM 360/40 in 1970 at 
Cal Poly SLO. Fun days.


On 8/23/2017 6:01 AM, 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.
>
> Rich
> ___
> PLUG mailing list
> PLUG@lists.pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug

___
PLUG mailing list
PLUG@lists.pdxlinux.org
http://lists.pdxlinux.org/mailman/listinfo/plug


Re: [PLUG] The joy of refactoring

2017-08-23 Thread Alan
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.

___
PLUG mailing list
PLUG@lists.pdxlinux.org
http://lists.pdxlinux.org/mailman/listinfo/plug


Re: [PLUG] The joy of refactoring

2017-08-23 Thread Rich Shepard
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.

Rich
___
PLUG mailing list
PLUG@lists.pdxlinux.org
http://lists.pdxlinux.org/mailman/listinfo/plug


Re: [PLUG] The joy of refactoring

2017-08-23 Thread Tom
Yes, Perl is fun:
* I do not recognize any Perl code I wrote more than about year ago -
despite all the evidence at hand
* Bugs you do not see do not exist AKA Schrodinger's cat AKA looking
for any stuff (code or not) makes it appear or disappear depending
whether you want to find it or not.
I have decades of experimental evidence to support it!
-T
On Tue, 2017-08-22 at 19:48 -0700, Alan wrote:
> Found an obscure bug in a Perl program that I started over 20 years
> ago. (I have made changes off and on since then.) Decided to rewrite
> it. Found even more bugs. (A few of the WTF variety.)
> 
> Sometimes a rewrite is a useful and needed thing.
> 
> ___
> PLUG mailing list
> PLUG@lists.pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug
___
PLUG mailing list
PLUG@lists.pdxlinux.org
http://lists.pdxlinux.org/mailman/listinfo/plug