Teaching python (programming) to children
jeff at ccvcorp.com
Sat Nov 10 01:09:27 CET 2001
John Roth wrote:
> "Michael Hudson" <mwh at python.net> wrote in message
> news:u4ro4nddv.fsf at python.net...
> > Laura Creighton <lac at strakt.com> writes:
> > > In the same vein, if any of you out there are writing (or revising)
> > > 'how to program in Python' books or papers, could you please put
> > > the section on exception handling _early_, say, right after 'what
> > > is a loop', rather than in the last chapter?
> > That's what my tech review for one such said over the summer :) This
> > may have been too late, of course.
> > But Laura is right here. Very very right.
> Then possibly the decision to make exceptions classes was
> wrong from a tutorial veiwpoint? Technically, it was the
> right decision, but it does shove exception handling rather
> late, after classes have been introduced.
> John Roth
Not necessarily. Unless you're defining your own exceptions, you don't have
any reason to care whether they are strings or classes or transfinite
cardinals. ;) A beginner doesn't need to know what a ValueError is, they
just need to know how to catch it, and when to expect it. The main
practical effect of using classes, is that you can catch a variety of
exception types by catching a base class, but I don't think this feature is
essential to beginners. By the time you're ready to exploit that
polymorphism, you should be ready to understand classes and inheritance
anyhow. (My $0.02, anyhow...)
More information about the Python-list