[Edu-sig] Re: Best approach to teaching OOP and graphics

Arthur ajsiegel at optonline.net
Fri Apr 1 15:59:49 CEST 2005



> -----Original Message-----
> From: edu-sig-bounces at python.org [mailto:edu-sig-bounces at python.org] On
> Behalf Of Beni Cherniavsky
> 
> I think teaching students to actively detest code that with huge redudant
> repetitive piles of redudancy repeated all over is more important than
> teaching them any single guideline.  

<Snip>

> Rule of thumb: use tuples where you typically change all members together.
> Use mutable objects (lists/dicts/objects with attrs) where you frequently
> change individual members.

The tuple/list distinction is a recurring question on python-list - people
trying to understand in what way the 2 structures are not redundant. This
comes up repeatedly ;) 

I find your formulation more satisfying than anything I've come a cross
before.

Art





More information about the Edu-sig mailing list