Psychology of Computer Programming
According to a paper I recently read (http://www.cs.mdx.ac.uk/research/PhDArea/saeed/paper1.pdf) there are, apparently, three kinds of people in the world. People who "are capable of seeing mathematical calculation problems in terms of rules, and can follow those rules wheresoever they may lead," those who "looks for meaning where it is not," and others who know that they are "looking at meaninglessness, and refuse to deal with it."
What's really interesting to me, as a programmer and recreational mathematician, is that apparently some people cannot wrap their heads around programming. This could be attributed to engineers teaching the classes for people who were basically born engineers, but it seems even math people would have trouble based on the hypothesized reason for this.
In the bizarro land we call programming, a=a can be either a command or a question depending sometimes on context and sometimes on symbol choice. In C derivatives, if you want to know whether a is equivalent to a then you use this snippet
which does essentially nothing. In order for this to be useful you have to store the truth value of the result. What if you need a constant? That's simple. In most languages, storing a number in memory is just this:
or, in C derivatives (except in special fancy cases as we shall see shortly)
If you've followed along so far, you might have started to form some kind of mental image of how these things work that you might be able to use to apply to further operations. So what is the final value of a after these lines:
hmm? I've seen several questions like this on first year computer science tests (often as extra credit), even though you would have to either be insane or some kind of paranoid obfuscation freak to ever use a line like that. If you think about it for a bit, you may come to the realization that (if this even compiles) a will be 1 (1 meaning true) no matter what a was.
So, should I be surprised that some people's brains simply refuse to operate on these things? It is the teacher's fault for being obtuse? Something more than either of those?