[Tutor] Program style

Michael Janssen Janssen@rz.uni-frankfurt.de
Fri Mar 21 12:33:26 2003


On Fri, 21 Mar 2003 vicki@stanfield.net wrote:

> I have a program which I have begun writing,
> and the code works but is not in appropriate OOP format
> (or doesn't seem to be). I am new to writing Python and
> OOP, having written C programs and the like for several
> years. If any of you experienced Python programmers
> could take a quick look and advise me on how to get
> this program into the appropriate style/format
> before it gets so large that it is a major job to
> revamp it, I would greatly appreciate it.

I'm not in GUI-Programming and not that much OOP but you have done two
*evil* things ;-)

* do not mix tabs and spaces for indentation. Do not mix four spaces
indentation with eigth spaces (I can't even fix this with emacs).

* please, when you need some non standart modules (serial, stdio and Pnm
are non standart for my python) give the novice user a hint, where those
modules reside.

The rest *looks* good to me (until line 80): In python you needn't stuff
anything into OOP structures (you can mix OOP and functional programming).

Michael


>
> --vicki
>
> P.S. I would like to create an __init__ function and
> change the root stuff to self. Should this whole thing
> be a class?