Unification of Methods and Functions

David MacQuigg dmq at gain.com
Mon May 24 18:36:21 EDT 2004


On Mon, 24 May 2004 13:59:55 +1200, Greg Ewing
<greg at cosc.canterbury.ac.nz> wrote:

>David MacQuigg wrote:
>> Given the goals of the level one and two examples ( cover all the
>> basic features in two simple examples ) I think any example will be
>> contrived.
>
>But I don't think you should be trying to cover all the
>features of OOP before showing any real examples. That
>approach seems almost guaranteed to lose people's interest,
>the way you criticised supplier-part examples for.
>
>Wouldn't it be better to do things the other way around?
>Pick some (simplified if need be) examples based on
>real-world problems, and, one by one, show how the
>features of OOP can be used to solve them.

There are lots of ways to write a book.  The way I've chosen is
following a pattern which I really liked in Introduction to Quantum
Theory by David Park.  He has a brief, but thorough presentation of
all the basics, supplemented by many examples in a second section of
the book. Read a few pages of theory, then read the examples and work
the exercises.  The first time through, it takes a while.  Then
reviewing the course later is a pleasure.

I think it is possible to present the basics of OOP in 8 pages.
Supplementary topics like robust programming techniques might add a
few more.  Examples and exercises could bring the total to 30, maybe
50 pages.  We're not planning any discussion of design patterns, which
could fill a whole book.  This is basic syntax only.

All of this depends on the students already understanding the topics
prior to Chapter 19, e.g. functions, modules, and global variables.

-- Dave




More information about the Python-list mailing list