As I move into my twilight years (mid 30s) I start to have flashbacks surrounding various aspects of my youth. This very morn', for example, I was whisked back to an endless summer evening circa the mid 80s... The scene is composed of; a large christmas tree, me, my grandmother, and our TV. Connected to the TV is my first ever computer: a SpectraVideo 318 (sold mostly in Japan and Sweden, apparently - but powered by the famous Zilog Z-80 chip [as seen to this day in my washing machine]).
Curious as to the purpose of these wondrous new consumer devices, my grandmother asked for a demonstration of how it worked. She was a teacher, I think (as a kid you don't really probe the lives of those around you) and I felt like this was a mini test, so I was determined to impress. Naturally I fired up BASIC to give her a taste of why she herself might want such a machine, and I wrote a small program to plot a sprite on the screen.
I could tell she hadn't quite grasped the awesomeness of it, so I proceeded to animate it. The animation code went something (but nothing) like this:
... 100 LET X = 0 110 PUT SPRITE 1, X, 100 120 LET X = X + 1 130 GOTO 110
I'd memorised the code from the user manual, or from another game, or something... so I was very unprepared for her sole question regarding the demonstration:
How can X possibly be X plus one?
I was confused.
Not about her question (I had no idea what she was talking about). I was confused because she wasn't in awe of the HUGE SMILEY FACE that I had just created and then made FLY RIGHT ACROSS THE SCREEN.
But she persisted with her interrogation of the single line of code, buried inside the very first program she had ever seen: how could "X" be "X plus one"? It just didn't make sense to her. If X is 0 then X is 0.
let keyword. As I typed it, I was transported back in time to that strange moment - I don't even know why it was locked in my head.
At any rate, I'm now a bit miffed that it took me 20-odd years to get up to speed with functional programming, but my grandma - who had never touched a computer in her life - understood immutability instantly and intrinsically.
See also Conventional Interfaces: map/reduce and friends.
Ah… the intricacies (sp?) of
the human mind.
I am surprised you or her did not know.
X can = (X + 1) when X is 0.
Like your site.
Funny, just last week I had a terribly heated argument with my girlfriend about this exact same thing!
I tried to explain the difference between equality and the assignment operator, and that this was programming, not maths… and that the line was evaluated, over time, right to left… all of which she happily ignored and still insists that she is right, I don’t respect her intelligence, I’m an idiot, can’t do basic algebra and “no wonder you find programming so hard”!
Seems more likely from this telling that she didn’t get that = means assignment in Basic, rather than being an assertion of equality as it would be where she’d likely encountered it previously — in mathematics. Still, she was clearly sharp because it’s an excellent question.
@Steve: No it isn’t. If she thought it was equality instead of assignment, and if X = 0 as you said, that would result in 0 = 1. So X=0 is not a solution.
@Steve: Clearly, X = infinity is a solution, and not 0.