[Tutor] if-else statements

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Sat Oct 15 10:20:17 CEST 2005



On Sat, 15 Oct 2005, Andrew P wrote:

> Well, on the bright side, at least Python is being taught in schools.

[Warning: I get totally off-topic, opinionated, and cranky in the
following rant.  My apologies in advance!]

Hi Andrew,

But I get worried, though, that much teaching uses fragile techniques that
don't really scale well.  I've disliked the order in which some Python
tutorials approach language features --- in particular, functions seem to
be given short shrift at times.

I think the concept of functions really need to come as soon as possible:
to me, they're essential core material, and functions need to be
introduced as a way to control program complexity and allow for testing.


As an example of a Python tutorial that ignores functions altogether is
Richard Baldwin's Python Programming Tutorial:

    http://www.dickbaldwin.com/tocpyth.htm

His tutorial doesn't even approach the idea of breaking down hard problems
into small ones: it just jumps right into language features, without
really providing the connective glue that puts it all together.

I hate being mean to him, but I really think that the particular tutorial
there is just poor, and its failure is a reflection on the misguided focus
on iterating through all the features and idiocyncracies of Python.  I
think those kinds of tutorials usually just end up convincing beginners
that programming is just a matter of tricks and silly details.

For simliar reasons, I really don't think the official Python Tutorial
belongs on the top of the Non Programmers page at
http://wiki.python.org/moin/BeginnersGuide/NonProgrammers: I truly think
beginners would scream in horror at it if they really tried to learn to
program from it.  *grin*


My point is that because something is being taught in Python isn't a
guarantee that good teaching is going to happen automatically.  In fact,
because Python's so featureful, I think it can be dangerously tempting for
a teacher or tutor to focus on Python-specific language features too much.
For folks who know the fundamentals of programming already, that's fine
--- they want to be productive --- but for a real beginner who is trying
to figure out this crazy programming stuff, that kind of focus can be
damaging.


I really wish that someone would take a similar approach in writing a
beginner Python tutorial that focuses on functions almost immediately,
even before control flow.  Something like:

    http://www.htdp.org/2003-09-26/Book/

for Python would be nice to see...


Anyway, sorry for ranting; I just get heated up when I see programs that
don't use functions at all.  *grin*



More information about the Tutor mailing list