Live data from Hacker News

Conversations with a six-year-old on functional programming

byorgey.wordpress.com

41–50 of 319 posts

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

#41
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 ?

Almost anything in the End User Development research field.

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

#42
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 ?

I don't think state is the problem. I think the visibility of state is a problem. In most programming, state is some nebulous thing that you really only get to see in a debugger. Otherwise, you're left reasoning about what you think the states are and can be. How many bugs trace down to statements like, "This data shouldn't be here."

That's why Excel works for so many people -- the internal and intermediate states can be as visible as the user needs or desires them to be. And those users seem to have no problem chaining together multiple cells into what is essentially a very complex function.

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

#44
post #14

When my son was around five or six, I did a similar exercise to explain the difference between prime and composite numbers. I told him that a number X is composite if you can fit X apples into buckets and end up with the same number of apples in each bucket. I drew 6 apples and asked whether they could be divided into buckets with an equal number of apples in each. It was immediately obvious that they could. My son c…

> I told him that a number X is composite if you can fit X apples into buckets and end up with the same number of apples in each bucket. Wrong; X is composite if you can fit X apples into buckets and end up with the same number of apples in each bucket, with at least two apples in each bucket . "You gotta tell the children the truth. They don't need a whole lot of lies. Cause one of these days, baby, they'll be runni…

Very true, and I did actually explain that to him. In my rush to tell a good story I left out the pedantic part.

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

#45
Brent is one of the greatest teachers I've ever experienced. I used to take classes from him (and TA some others he taught) and was consistently blown away by his enthusiasm and capacity for sharing concepts. He has a great essay on pedagogy as well (https://byorgey.wordpress.com/2009/01/12/abstraction-intuiti...)

If you're interested in learning some of the beautiful foundations of functional programming, I highly recommend checking out the lecture notes and assignments from his Penn CIS 194 class (http://www.cis.upenn.edu/~cis194/spring13/lectures.html)

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

#46
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 ?

Lisp is perfectly suited for this task due to the minimal and familiar syntax to non-programmers. Math should be taught in prefix notation if u ask me.

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

#47
This is fantastic. Reminds me of Hofstadter's conversations between Achilles and a Tortoise.

The trouble with most math I've encountered isn't the concepts, it's the quality of the abstractions we use to represent and interpret them.

The best(worst) example I can think of is the Alice/Bob description of cryptographic protocols, where somebody's idea of teaching is, "let's take these symbolic representations and instead of just shouting them at you slowly, I will obfuscate them with a set of conceptually unrelated words and repeat the representation word for word in a more patronizing way."

Great piece of writing.

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

#48
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.

I'm a father of two girls, ages four and nine.

Explaining things to them and seeing the dawn of understanding in their eyes in easily my greatest joy in life. As a parent, I basically get to relive this xkcd[0], over and over, every day.

We take it to an extreme - we unschool[1]. We do our best to treat our daughters as any other member of the family, expecting to act as adults to the extent that they're able to do so. My nine-year-old spends much of her days right now playing Roblox and Star Stable, but even that is punctuated by her coming to us with random questions about things she's interested in. If I'm not head-down on a project I take the time to explain as best I can. If I'm otherwise occupied I always at least take the time to say "Go search for " and follow up with once I'm free.

The results have, so far, been incredible. Our oldest was a late reader by the standards of the testing done in government schools, but once she ran into something she wanted to do that could only be accomplished by reading, she achieved fluency more quickly than I would have ever expected. For what it's worth, that "something" was an online RPG where she had to do quests to progress. In order to do that, she had to be able to read the quest text.

These days she's engrossed in the "Pegasus" series by Kate O'Hearn, and devouring them at a rate of ~1k pages per week. She'll have finished the series by the end of this week and I'm hoping she'll pick up Asimov's "Norby" series next. If not, she'll find something else that interests her and continue reading well into the wee hours of the morning I'm sure.

0: https://www.xkcd.com/1053/ 1: https://en.wikipedia.org/wiki/Unschooling

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

#49
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 an immense amount of effort to do it consistently. And it gets harder with each kid, at least for me.

One of the things you figure out is that some kids aren't interested. And if your kid isn't interested in thinking about prime numbers, you're going to be hard pressed to change that. Conversely they will have interests that you don't share, and it's going to be harder for you to participate meaningfully in that beyond being generally supportive. They are individuals that way.

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

#50

This is fantastic. Reminds me of Hofstadter's conversations between Achilles and a Tortoise. The trouble with most math I've encountered isn't the concepts, it's the quality of the abstractions we use to represent and interpret them. The best(worst) example I can think of is the Alice/Bob description of cryptographic protocols, where somebody's idea of teaching is, "let's take these symbolic representations and inste…

I for one really like reading about Alice and Bob. Amongst other benefits, it helps me consider how, even if currently just a theoretical algorithm, that particular protocol could end up being used in real world communications.
Post reply on HN