Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #61594

Re: Experiences/guidance on teaching Python as a first programming language

References (1 earlier) <201312090824.25211.gheskett@wdtv.com> <52A78F6F.3060507@stoneleaf.us> <CABicbJKoN9fV48yskd5wqE79vsb5=nPGfwgOTCO+fCFMG7g8qw@mail.gmail.com> <CAPTjJmpQ9bFP66j3p-PDb2Mp88GKWKktrcFRCWQtdo6fb8LHmA@mail.gmail.com> <52A88C66.8050103@gmail.com>
Date 2013-12-12 03:14 +1100
Subject Re: Experiences/guidance on teaching Python as a first programming language
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.3912.1386778455.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Thu, Dec 12, 2013 at 3:01 AM, bob gailer <bgailer@gmail.com> wrote:
> One student (PhD in Physics) looked at X = X + 1 and said "no it doesn't".

Yeah, which is why some languages (I first met it with Pascal) spell
that as "X *becomes* X + 1"... but regardless of what you call it,
there's a fundamental difference between algebra (where every line is
a statement of truth) and imperative programming (which may change
state as time progresses). What's called a "variable" in programming
really can vary; in maths, it's really just an "unknown". This is a
difference that, one way or another, just has to be taught.

> Another wrote his first program. I took one look at it and saw the mistakes.
> I explained how to walk thru the program step by step. He exclaimed "In that
> much detail?".

You mean a dry run [1]? Yes, can be tedious. Can also be very VERY
valuable, especially if done verbally to another programmer, as a
means of spotting differences between what the programmer thinks
something does and what the language thinks it does.

x = a * b + c

"Set x to a times the sum of b and c."

ChrisA

[1] http://foldoc.org/dry+run

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Experiences/guidance on teaching Python as a first programming language Chris Angelico <rosuav@gmail.com> - 2013-12-12 03:14 +1100

csiph-web