News for hackers. Stuff that matters.
Re:Even my grandmother got immutability by michael_dorfman on Monday November 28, 2011 @10:27AM (#3286200)
Actually, what grandmother got was something different: the problem of overloading the "=" operator with variable setting. If you instead use, for example, arrows (as Knuth does in TAOCP) the problem goes away, and grandmother is no longer confused.
Re:Even my grandmother got immutability by giberson on Monday November 28, 2011 @01:42PM (#3287035)
As much as I'd love to imbue his grandmother (and by extension all grandmothers) with innate understanding of some programming principle that some seem to have trouble with I'm afraid this event or at least the authors recounting of this event does not lead to that conclusion.

The grandmother may not have been having trouble with the immutability of X. Her question was not "how can X be anything other than X?" It was "How can X be X+1?". Which could convey the more likely case of the unlearned coder not understanding the order of operation in program flow. I'm sure she understood that X could be assigned a value, I'm sure she even understood that X could be changed--what she was having trouble with, most likely, was how could you use X on the right hand side of the equator? How can you define a value with the value itself (Circular reference). And I can totally relate--when I first learned programming it was something that confused myself at first as well. I hadn't learned that the right hand side of the equator gets evaluated with X being resolved to it's "present" value which is then used to calculate the value and finally stored back in the variable.

I hate to be a downer, it certainly is a fond memory, but the initial supposition is inconclusive.

Re:Even my grandmother got immutability by biot on Monday November 28, 2011 @02:26PM (#3287206)
Grandmother parses code as X == X + 1. Hilarity ensues as her confusion of the misapplication of the equals sign from math is later mistakenly attributed to a grasp of immutability.
Re:Even my grandmother got immutability by sk5t on Monday November 28, 2011 @11:00AM (#3286362)
The article mentions that grandmother was possibly a teacher, and it seems reasonable for a schoolteacher to be confused by programming's "variable x" vs. algebra's "unknown x", in addition to the confusion of "assignment operator =".
Re:Even my grandmother got immutability by fogus on Monday November 28, 2011 @10:49AM (#3286314)
Another grandmother gets thrown under the bus. Grandma as the archetype of computer ignorance is a played out plot device.
Re:Even my grandmother got immutability by huxley on Monday November 28, 2011 @02:28PM (#3287215)
I've disliked that stereotype for a while.

My mother (who is 68) started off programming with punchcards when she was working on her Masters in Economics, she eventually moved into executive work but still kept up her chops with Basic and Fortran well into the 1990s. Nowadays, she uses VNC to telecommute into work every morning to avoid having to deal with traffic.

If I had married earlier and had kids as soon as some of my schoolmates did --and my kids did the same in turn-- she could have been the great-grandmother of 20+ year olds.

I think we should almost be to the point in computer history where age-based archetypes/stereotypes of computer ignorance can be safely retired.

Re:Even my grandmother got immutability by moheeb on Monday November 28, 2011 @02:47PM (#3287295)
Haha...you've got to be kidding!

Have you ever seen an old person drive?

Re:Even my grandmother got immutability by llimllib on Monday November 28, 2011 @11:24AM (#3286463)
but... in this story Grandma's the hero and the one that gets it, right? So this Grandma doesn't "get thrown under the bus".
Re:Even my grandmother got immutability by zephjc on Monday November 28, 2011 @11:33AM (#3286499)
Well, the author unknowingly does: his grandmother mistakes the assignment operator for the equivalence operator.
Re:Even my grandmother got immutability by rdtsc on Monday November 28, 2011 @12:12PM (#3286658)
Actually, he points out his grandmother is well ahead of you fools since she has an intuitive understanding of immutable data structures and is distraught that one would modify state in-place like that.

In her head she probably thought, "hmm that's what the state monad is for" or something like "yeah that'll get you in trouble when you make your code multi-threaded".

Re:Even my grandmother got immutability by sliverstorm on Monday November 28, 2011 @05:23PM (#3287898)
Hardly a mistake only made by grandmas.
Re:Even my grandmother got immutability by skatenerd on Monday November 28, 2011 @10:26AM (#3286193)
sounds like she might not have been confused if the bit to the right of the equals sign didn't contain an "X".

in other words, maybe it's not mutability that is confusing her.

...this isn't to say i'm not a huge fan of immutability :-)

Re:Even my grandmother got immutability by joejohnson on Monday November 28, 2011 @03:18PM (#3287430)
I don't think is relates to immutability. This is an example of the "=" operator being overloaded for assignment.
Re:Even my grandmother got immutability by pktm on Monday November 28, 2011 @05:04PM (#3287839)
I have to confess that I read this as his grandmother _acquiring_ immutability, the way, say, one might _get_ "+5 health" in a game.

Why you'd want an immutable grandmother, I'll never know.

Re:Even my grandmother got immutability by ionfish on Monday November 28, 2011 @10:08AM (#3286117)
Another nail in the coffin of the claim that imperative programming is more intuitive, persistently asserted without good evidence.

I submit that when people make claims of this sort, what they usually mean is actually "I'm used to doing it this way". Some actual studies of how new programmers learn would be valuable, and allow us to begin to evaluate claims like the above with at least a modicum of objectivity.

Re:Even my grandmother got immutability by michael_dorfman on Monday November 28, 2011 @10:30AM (#3286209)
I don't think that referring to a single anecdote as a "nail in the coffin" of a position while complaining of the lack of "actual studies" in support of that position is terribly consistent.
Re:Even my grandmother got immutability by ionfish on Tuesday November 29, 2011 @08:41AM (#3290229)
The position I'm attacking is the claim that it's just obvious that imperative programming is more intuitive, not that it is more intuitive. By exhibiting counterexamples to this supposedly obvious assertion, it's shown that it is not in fact obvious. Whether imperative or declarative programming is in fact more intuitive is, of course, not something to be settled by the anecdote give in the link.
Re:Even my grandmother got immutability by gtrak on Monday November 28, 2011 @10:59AM (#3286359)
This is explored very well in Rich Hickey's 'Simple Made Easy' talk, check it out: http://www.infoq.com/presentations/Simple-Made-Easy
Re:Even my grandmother got immutability by forensic on Monday November 28, 2011 @04:14PM (#3287649)
this isnt an issue with imperative programming, it's an issue with BASIC and the stupid way that computer scientists use math symbols
Re:Even my grandmother got immutability by bad_user on Monday November 28, 2011 @02:48PM (#3287297)
Sweat anecdote, however it has even less value than people realise.

If you want to explain an algorithm to Grandma, it's far easier to make her think at cookbook recipes -- X is a cup of sugar, now imagine that at every step you're adding one more cube of sugar to it.

Re:Even my grandmother got immutability by edw519 on Monday November 28, 2011 @12:24PM (#3286708)
There are a few quotes from college I'll never forget. One of them was by my chemistry professor who said, "I have a great deal of respect for the equal sign."

He put one student's homework on the screen. Instead of answering:

  A + B = C
  C + D = E
she took this shortcut:

  A + B = C + D = E
(Variables replaced for simplification.)

It was clear what she intended, but what she ended up with was a total fail.

Funny this post reminded me of a little incident and a great quote so many years ago. To this day, I still have a great deal of respect for the equal sign.

Thank you, Professor State...

http://sites.allegheny.edu/magazine/fallwinter-2003/best-abo...

http://www.memorialsolutions.com/sitemaker/sites/hathew0/obi...

EDIT: I just realized that Professor State's class was one of the few that actually helped me develop good work habits for life. I once wrote about that here on HN:

http://news.ycombinator.com/item?id=1544573

Re:Even my grandmother got immutability by Thieum22 on Monday November 28, 2011 @10:50AM (#3286315)
Great example of "Involuntary Memory" : http://en.wikipedia.org/wiki/Involuntary_memory
Re:Even my grandmother got immutability by Muzza on Monday November 28, 2011 @11:31AM (#3286490)
Dijkstra's mother asked the very same question. The story can be found somewhere in the EWD archives[1].

[1] http://www.cs.utexas.edu/~EWD/