
How high school students start thinking about code - llimllib
http://computinged.wordpress.com/2009/07/05/how-high-school-students-start-thinking-about-code/
======
joechung
"He hadn’t quite internalized left-hand side vs. right-hand side." This is
noteworthy.

In mathematics, equality is symmetric (a=b is the same as b=a).

In programming, variable assignment is asymmetric (a=b is not the same as
b=a).

Some programming languages recognize this but get the change wrong by changing
the equality operator to == or === and always preferring assignment to be =.
Some get it right, e.g., := as assignment.

~~~
mattmcknight
Yes, but don't overlook the "Let x =" syntax of mathematics. Programming has
just dropped the "let". So, really there is a choice to be made about how to
resolve that ambiguity in a language parser. Visual Basic has the nice case of
A = B = C setting A equal to the boolean expression B = C.

~~~
jules
Let in mathematics doesn't really work that way. It's more general.

"Let <boolean expression>" means that the world gets set up so that the
boolean expression is true.

Examples:

Let x=4

Let epsilon>0

Let a in A

There's very interesting work on providing an iteration construct like this in
a programming language.

<http://www.cs.cornell.edu/Projects/jmatch/>

------
euroclydon
I would like to see someone take one thousand twelve year olds, stratify them
and randomly split them up into groups of two hundred for the summer and teach
each group basic programming using five different languages: Python, Basic,
Scheme, and a couple more, then at the end, perform some type of objective
programming skills evaluation to determine which language really is the best
for beginning learners.

~~~
mahmud
I tried that with just two kids using PLT Scheme and Javascript. The biggest
hurdle is convincing them that software is useful outside the development
environment; we wrote apps for the desktop/GUI, console, and MySpace. Kids
then tried to customize everything, including system utilities, Open Office,
and their own 3rd party games. It was baffling how much they expected from
their programming tools; they demanded full integration between compiler and
whatever else they were running on their system. They don't understand that
some software is extensible (The Dr. Scheme IDE) and others are not
(Minesweeper, Bejeweled.), but that was mainly my fault because I did some
magic behind the scenes and put their javascript "commands" in the firefox
toolbar.

My nephews kept thinking of functions, operators, and special forms
(conditionals and iteration) as "objects". They wanted to put "title", "value"
and "callback" on the "wrong" objects. For example, they could bind a callback
to a button and have it popup when it was clicked; they want to attach a
similar callback to a block of code and have it fired when the block was
executed (a trivial problem to fix; just call your callback from the body of
the code block, but they wanted to use call-back syntax.)

I am sure they would have loved Squeak, but I didn't have the time to learn it
on time; my previous experience with Smalltalk has been brief, mainly with GST
and theoretic uses of Self.

Kids are a tougher crowd to please than programmers with some "training",
because children have not yet accepted whatever limitations imposed at us by
"industry". They want the Ideal.

~~~
omouse
_they demanded full integration between compiler and whatever else they were
running on their system_

Which is what _everyone_ should be demanding. What's the point of software
that you can't program yourself?

------
azanar
I had a similar experience when helping a friend with a bug in his code from
an introductory programming course at my alma mater. The programming
assignment involved manipulation of an array of data in C, and there was a
counter variable involved to keep track of which element of the array was
currently being manipulated.

He understood that there was a relationship between the array and the counter
variable, but he took the relationship to far. He thought that the counter
variable needed to _represent_ the element of the array, and so he was
assigning the value of the particular element in the array to the counter
variable. In his mind, the counter variable didn't just provide the element
number to look for; it _was_ the element he was looking for, or at least it
needed to become so.

Both this, and the color example provided by the author, demonstrate how many
implied relationships we depend on within the programs we write, and how many
people believe that those relationships to be explicitly stated or else the
compiler won't _understand_ what we mean.

I don't think I was able to get my friend to really understand what was going
on and why we couldn't just 'tell' the computer to 'relate' these two things
for us. It was a level of such naive concreteness that his mind just fought
against descending to. I wonder how someone might educate people in thinking
at this level? The optimist in me says it might be possible; the pessimist
suggests that it might be in the same realm as trying to get people to
understand pointers and recursion, which enough people I've read suggest is
extremely hard for some (many?) people to understand.

~~~
omouse
This is where variable names help. I wouldn't call it a "counter", I would
instead call it an "index" or "position". Then you have a separate variable
called "element" for the specific element of the array, or whatever.

------
krakensden
It's interesting to read that. I've always found it hard to explain
programming language problems, because I internalized so many conventions so
long ago. It can be a challenge to plumb your memory and list all the
interesting bits.

------
erlanger
7th grade, TI-BASIC. That's what got it started for me. The book that came
with the TI-83 had a little chapter on the built-in language and I ran with
it. No student with any knowledge of algebra and symbolic mathematics should
be making these errors (shown in the article) with named arguments
though...that's just weird. Who sees "0 = x" in class?

~~~
TravisLS
Thanks for the flashback. I wonder how many HN members got started on their
TI-83. I remember even the most remedial users figuring out how to store
enough data to cheat in pre-calc. IMO, the language is less relevant, it just
takes a project.

~~~
rottencupcakes
The first real applications I ever wrote were TI-Basic apps I wrote for my
TI-89 back in Algebra class.

I remember coding them directly with the keyboard on the calculator. I wrote
all kinds of things, things to help me solve things, solve equations, geometry
solvers, games. It was a blast, and I think that's what got me interested in
programming.

Thanks TI! Maybe Middle Schools should work on developing an introductory
programming curriculum to introduce kinds to the idea of programming. It's
probably more important then most things middle schoolers are learning,
especially considering I probably spent so much of my time in math class
programming my calculator.

