Seriously. He couldn't comprehend:
X = X + 1
To be fair, that might seem paradoxical, but I would break it down for him, going step by step with cards and boxes labeled by the variable names. He just couldn't comprehend. He had a hard time with variables. Heck, I think he had a hard time with anything but social interaction. What was disturbing to me, was the amount of energy he devoted to sucking up to me and trying to scam me by mimicking the "Ah-HA!" moment.Other disturbing observations: many of my fellow grad students didn't get it either. To them, the C compiler was just magic. No understanding of how things were marshaled on the stack or how operations were implemented in machine language. Surprisingly, they were often about as bad as the local community-college students who got employed by a local corporate body-shop.
At one point, one fellow grad student got exasperated at me in a study session and said, "I don't care about the principles, just give me the answer so I can get an A on the test!" She later told me she was just planning to go into management anyhow. (In a way, that was really disappointing. She was one of the few women in the program, and pretty cute.)
IMO it's a serious bug in the educational system that people are able to pass by following that approach.
(Then, in "real life", you are really on your own. If you are doing something new and original, you won't know if you are right immediately. You have to convince yourself by applying what you've learned. The answers to test questions, in this case, are completely meaningless. I don't think enough people realize that.)
Maybe replacing the "=" with an array while teaching would be helpful. Then once he understands the concept, try to introduce the "=" syntax.
I really don't have a problem with people not getting x=x+1, I think it shows someone is actually trying to deeply understand what is going on.
Say you want to print 2+2. In assembly, you have to put a two in two certain registers, then call add, then call a routine to convert the number 4 to the string "4\0", then find a file descriptor, then signal the OS that you want to make a system call (fwrite), ...
That is not a good way of teaching how computation works. The details in this case are arbitrary and irrelevant; there is no reason a computer has to distinguish between the string "4" and the result of adding 2 and 2.
Can you tell I'm a programmer, not an archer? (actually, I have practiced archery in the past)
I could understand why if a mathematician found it odd - of course in practice they would understand it, but they would probably in their head make the left most X to be X' or somesuch so they could understand what was going on.
When you do a mutation of a variable - there are all sorts of subtle things to understand about the machine underneath that you wouldn't have to if everything was immutable. I guess its easy to forget that in the day to day.
- Machine Language
- Compiler Construction
- Operating Systems
Just after that, a bunch of lightbulbs started to fire off. I think the NAND to Tetris approach is really great in this regard. It's designed to be the place where it all comes together for a Comp Sci person.Isn't that really all there is to comprehend, when you get right down to it?
For all the people who don't "get" programming, I think that's exactly what they don't get.
Unless you're teaching functional programming. Then it would be f(x).
Any sufficiently advanced technology is indistinguishable from magic. - Arthur C. Clarke
it must have been too advanced for them? :)
In my "Intro to programming with Java" class a few years back, it took people three or four weeks just to be able to install java, set up the path in the environment variables on their home computer and compile a "hello world" program. If you were raised on Windows, and you've never used a command line before, it can be a challenge to figure out.
I suggested to every teacher as well as the dean of the program that if they're committed to Java as a first language, then offer students a pre-configured VMware Virtual Appliance with a Ubuntu install with the programming environment preconfigured and set up for the students. That way, they could download the appliance or hand it out on CD, download VMware player and start programming.
Instead, the teacher was playing sysadmin for java installations on Windows boxen.
It's a shame that so many schools teach Java as a first language. I think there's probably a lot of people with aptitude and interest in programming that might get into the industry, but who are put of by all the initial overhead associated with java and sys admin stuff.
I think he's up against a bug in the curriculum and not just people's limitations.
Programming has the property that those who wish to practice today have almost unlimited opportunities.
This might explain the wildly different levels of skill that the poster observed. Perhaps programming would be best self-taught in a workshop setting so folks at different levels don't get in each others' way.