At the age of 60 years, I feel as though I have entered a marvelous
new phase of computer programming.  It brings to mind this quotation
from Hokusai, one of the great masters of Japanese wood prints:

"From the age of six I had a penchant for copying the form of things,
and from about fifty, my pictures were frequently published; but until
the age of seventy, nothing that I drew was worthy of notice. At
seventy-three years, I was somewhat able to fathom the growth of
plants and trees; and the structure of birds, animals, insects and
fish. Thus, when I reach eighty years, I hope to have made increasing
progress, and at ninety to see further into the underlying principles
of things, so that at one hundred years I will have achieved a divine
state in my art, and at one hundred and ten, every stroke will be
as though alive."

In later life, Hokusai signed some of his works, "The old man, mad
about painting."

I started programming in my early twenties.  Now, I often think of
myself as "the old many, mad about computer programming".  Someday I
hope to do something worthy of notice :-)

Last night I fixed a difficult bug deep in the bowels of pylint.  It
required a debugger that would stop at any specified stack depth.  In
effect, the debuggers simulates Python's internal RuntimeError before
it actually happens.  It was easy to do this by subclassing Python's
standard pdb debugger.

With this tool in place, I could run pylint dozens of times without
having to set breakpoints--I could just run the debugger and it would
"automatically" tell me where the problem was.  This allowed me to
alter the pylint code to see what would happen.  Without this tool, it
would have taken 100 times longer to find out what was happening.
This was the reason I was able to fix the bug before others who knew
exactly where the problem was.

Before I got around to fixing the bug, I wrote a script (in Leo of
course) that would dump the contents of Python's ast (Abstract Syntax)
trees in various ways.  I did this to familiarize myself with what
ast's are and how they "work".  This was active preparation for
digging into pylint.  No, it wasn't strictly necessary, but it was
useful psychologically and practically: it gave me intimate knowledge
of ast data structures.

At the start of this post I said I have entered a marvelous new phase
of computer programming.  I call it the active phase.  The passive way
would simply be to study a problem, read the code and the
documentation, do some hand tests.

In contrast, the active phase creates tools, prototypes and tests,
especially unit tests.

The ast dumper was part of the actives phase.  So was the new
debugger.

As another example, I am interested in improving pylint
significantly.  There is no doubt in my mind that this can be done.
The passive way would be to study pylint code.  The active way would
be to design a better pylint first, then compare the design with the
existing pylint code.  I have begun that design, and will discuss it
in another post.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.

Reply via email to