Unification of Methods and Functions

Greg Ewing greg at cosc.canterbury.ac.nz
Thu May 6 23:20:09 EDT 2004


David MacQuigg wrote:
> We disagree on what is "waffle" and what are beneficial extra words.
> Your explanation, to me, seems more like a "man page" than a textbook
> explanation.

The number of words used isn't really the issue here.
Any explanation can be expanded or contracted to adjust
the pace to the intended audience. What's important is
the structure of the explanation, and whether the structure
forms a logical flow of ideas that can be easily followed.

The original explanation you quoted, it seems to me, is
harder to follow than necessary because it takes a somewhat
tortuous path to explaining what is going on.

It starts out by saying "Some of the variables in
this function are prefixed by 'self.'...", as if something
very new and mysterious is being introduced. It then spends
the next couple of paragraphs explaining this new concept.

At the end of all this, the reader, if he/she is sharp
enough, will realise that it isn't really a new thing at all,
but just a particular application of something already
encountered, namely attribute access. If he/she isn't sharp
enough, he/she may be left thoroughly confused and still
thinking it's some new mysterious feature.

I was trying to show how the presentation could be made
easier to follow by starting from the other end, and
explaining how Python makes use of things already
encountered -- parameter passing and attribute access --
to provide instance variables.

In other words, your solution to badly-written tutorials
appears to be to redesign the language. Mine, on the other
hand, would be to re-write the tutorials so that they're
better.

-- 
Greg Ewing, Computer Science Dept,
University of Canterbury,	
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg




More information about the Python-list mailing list