[Edu-sig] Python as a first language for computer sciencist
Kirby Urner
urnerk at qwest.net
Thu Oct 20 03:11:10 CEST 2005
> But that's probably a few years in.
>
> Art
>
>
My inclination is to introduce testing pretty early, treating tests like
comments -- a good habit, supporting what in some situations is essential
practice.
Unit testing frameworks tend to be overkill though, on a first pass. I was
thinking more in terms of doctest:
http://docs.python.org/lib/module-doctest.html
This lets us promote commenting and testing at the same time, i.e. document
your function with a couple use cases (as if this were a shell session) and
be done with it.
In general, I believe in using pre-written code, not starting from a blank
page. This is how we learn to read human languages to: we get finished
examples to parse, don't have to write in a vacuum.
So, a first exposure to tests will be in the form of already-working code.
Sometimes we make some changes to *intentionally break* working code.
Kirby
More information about the Edu-sig
mailing list