[Python-talk] Code like a Pythonista
hewitt_tech at comcast.net
Thu Jul 26 09:37:20 EDT 2007
On Thu, 2007-07-26 at 08:34 -0400, Ben Scott wrote:
> On 7/26/07, Kent Johnson <kent37 at tds.net> wrote:
> > http://python.net/~goodger/projects/pycon/2007/idiomatic/
> Good link. Thanks!
> I find it interesting that a lot of the advice in that document
> applies equally well to other programming languages, and indeed, to
> design in general.
> I particularly love this quote (which is new to me):
> "Debugging is twice as hard as writing the code in the first place.
> Therefore, if you
> write the code as cleverly as possible, you are, by definition, not
> smart enough to
> debug it."
> -- Brian W. Kernighan
> I think the underlying principle there (pushing the edges of the
> ability for humans to understand something) explains why a lot of the
> systems that stinks stink. Anything that complicated (I'm thinking
> most anything from Microsoft) is going to be impossible to truly grok.
I worked for a number of years building and releasing compilers for DEC.
One of the common attributes of inexperienced engineers was that they
weren't very good at debugging code. They would write new routines,
modules to add to a compiler project (and the typical compiler comprised
more than 1 million lines of code) and then thought they were done. Of
course the senior engineers/staff knew better and then would start
asking about what testing had been done, were any new QA tests added
Another interesting aspect of having FOOS (Fresh Out Of School)
programmers was that when they started on a project they often thought
the existing code was crap. Only after they had spent 6-10 months
learning how the code worked did they come to appreciate the skills of
the people who had originally created it.
> One of the things that attracts me to Python is that the culture
> around it seems to really appreciate that *good design matters*.
Me too. I'll take clarity every day over clever. Good design starts
before any code is actually written. I've known programmers who spent
weeks and even months thinking about the problem before they actually
started writing any code. The end result showed that all that up front
work mattered. Their designs and the code that instantiated it were more
maintainable, performed better and just plain stood out as jewels when
you looked closely.
> See (some of) you tonight.
Which I were going to be there. I'll be installing software tonight from
8 till midnight.
> -- Ben
> Python-talk mailing list
> Python-talk at dlslug.org
More information about the Python-talk