[Tutor] List exercise

Michael Janssen Janssen@rz.uni-frankfurt.de
Mon Feb 10 13:02:02 2003


On Mon, 10 Feb 2003 alan.gauld@bt.com wrote:

> The only problem with this approach is that learning by experience
> can teach an awful lot of bad habits that are hard to break. Using
> a tutorial that teaches good habits early saves a lot of time in
> the long run because you don't have to unlearn so much.

When I remember correctly the threads "list exercise" wasn't such a shiny
example of good programming style, was it?

Taking up bad habits while learning by experience is truely a weightfull
argument, but isn't it said that python protects the learner from bad
habits? And also, that you can learn python very fast, write usefull code
and *grow with* the language? A python learner doesn't start with bad
habits (solong s/he doesn't come from a bad habit language ;-); s/he
writes somewhat simpleminded code that's all.

I don't want to suggest never read a tutorial - but I can't see a need to
elaborate about tutorial examples when the real world is that near.
Especially when the examples are more complicated than the real world: you
wont often get a list of ints, strings, lists all mixed together in a
reasonable programm-design, will you?

Anybody who comes to the tutor-list claiming that s/he got a internal data
structur like:
['spam!', 1, ['Brie', 'Roquefort', 'Pol le Veq'], [1, 2, 3]]

would gain some remarks about using dictionaries to count strings (or
whatever else might be archived with the above list).

It's very interessting - for me as a student of educational sience - how
tutorials claim to explain something but tries to accomplish this effort
on objects, which are harder than necessary (to say the least).

Reading (well-written) existing code is a way out - as Erik Price recently
suggests.

Michael