[Tutor] Re: first program

Daniel Ehrenberg littledanehren at yahoo.com
Sat Dec 6 10:35:50 EST 2003


RoT wrote: 
> mmm, I worked through 'python for non-programmers'
> and then 'Learning Python' by Mark Lutz and David
> Ascher, which I now realise was updated last in
> 2000. I suppose I now need to locate some sort of
> changelog to study or a more up to date tutorial.
> 
Try learning from the official PSF Python tutorial.
It's pretty good for beginners (I learned from it) and
it is updated for every release of Python.

> mmm, without any guidance on the matter I decided to
> write into functions code that was to be
> reused, and code that sort of stuck out on its own.
> In hindsite I could have put it all into
> functions and only have 10 or 20 'main()' lines but
> I was not sure this would aid the readibility,
> I presumed a more structural approach with a
> functional/oo approach when needed for code reuse,
> would be the way to go. Are you advocating putting
> as much code as possible into functions?
> 
That would be a good solution. The main() function
often performs a narrow function within the range of
possible things that the script can do as a library.
The less is in the main function, the easier it is to
make new functionality for programs.

Daniel Ehrenberg

__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/



More information about the Tutor mailing list