Live data from Hacker News

Conversations with a six-year-old on functional programming

byorgey.wordpress.com

31–40 of 319 posts

Re: Conversations with a six-year-old on functional programming

#31
post #6
post #3

What is truly astounding about this is the patience to even attempt to explain free theorems to a 6 year old. Most parents would likely answer "math" and that would be the end of it. I don't (yet) have kids, but when I do I hope I have the wherewithal to recognize and take advantage of moments like these.

It's fun to talk to kids! Many of them are way more curious than most people are.

And it is endlessly entertaining to see just how quickly their minds can wrap around a subject you would think is too advanced for them. Its a matter of establishing a common language. Seeing that light go on in their eyes is unbelievably satisfying.

Re: Conversations with a six-year-old on functional programming

#35

Earlier quoted context omitted.

The child was stuck on the intuition that the argument must change in some way (i.e. that the function was linearly typed).

This and this: >> I think he was just stuck on the idea of the function doing something arithmetical to the input, and was having trouble coming up with some sort of arithmetic procedure which would result in 6 no matter what you put in don't really seem, to me, like they can explain what's happening -- f(x) = 6 is trivially easy to express in terms of arithmetic operations being applied to x. If you assume that a fu…

>what's wrong with a function that multiplies by 0?

Obviously the fact that it doesn't seem to have any visible effect on the input -- and people expect the input to be affected.

Re: Conversations with a six-year-old on functional programming

#36
Cool game; used to do something like that with kids, but more in context of sequence patterns. still, the game is limited to functions that are specified intensionally. Extensionally specified functions with no readily identifiable intension (like a function whose pairs are the result of a random pairing) are not really guessable. Oh well those are boring anyway...

Re: Conversations with a six-year-old on functional programming

#39
post #19

Side question: maintenece of functional programs is easier, because you don't need to think about state. Could it be used to create a functional programming language, easily understood by non-programmers or beginners , so they too could take a program and adapt it to their needs ? Does such language exist ?

Maybe Pyret? https://www.pyret.org/

I actually really like the look of that. One of my friends is learning to program (in Python) and has recently taken an interest in FP. Planning to show this to her.

Re: Conversations with a six-year-old on functional programming

#40
post #3

What is truly astounding about this is the patience to even attempt to explain free theorems to a 6 year old. Most parents would likely answer "math" and that would be the end of it. I don't (yet) have kids, but when I do I hope I have the wherewithal to recognize and take advantage of moments like these.

Note kid asked "dad what are you doing", not "what is functional programming". That's a simple call for attention, and it was equally suitable to close the book and play frisbee with him.
Post reply on HN