Live data from Hacker News

Conversations with a six-year-old on functional programming (2018)

byorgey.wordpress.com

1–10 of 161 posts

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

#3
I find kids understand the concept of functions really intuitively if it is stated simply - input -> func -> output, it doesn't have to be difficult maths, and it can make for some great games. It looks a little intimidating if using the notation in this article but they easily grasp that a function transforms inputs and returns outputs, and it can be a fun introduction to maths and programming, and then later to things like graphs based on functions.

Another game I play with my kids to introduce the concept of functions which aren't just for numbers is a haircut function. You start by deciding on what the function does (curls hair, cuts it short, makes it longer), write that in the middle of the page, then you draw some input people on the left of the page, and on the right hand side draw the output for each input. Bonus points for running the function twice to see what happens to that person. This is a popular game with my kids and gets them involved as they can draw their own.

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

#4
post #2

My seven year old would glaze over somewhere in the first sentence and switch topics to Pokemon. Your child might be gifted.

Nobody will remember that nerd, though. Now, your kid...your kid's name will be echoed in the halls of Gym Leaders worldwide.

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

#6
I remember the first time this was posted, almost 2 years ago. I've played the functional machine game with my daugther (then 6) a lot since, and she still at times ask if we should play! It's such a good way to make things like these interesting. Thank you!

ps. Maybe add [2018] to the title?

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

#7
>> a free theorem is when you can say something that is always true about a function machine if you only know its type, but you don’t know anything about what it does on the inside.” This seemed a bit beyond him...

To be fair, this is a bit beyond most who had no contact with functional programming and category theory.

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

#8
I will try to remember this in a few years time!

We inadvertently taught our 2yo something which I think relates to programming. We play an animal-pairs-matching card game, with the twist that if you draw a shark card you can then steal a card off another player (while pretending to be a shark, obviously). Inadvertently my wife and I had taught different rules: I taught that pairs already matched up were safe from the sharks, while she taught that they weren't. So now every game has to start with 2yo deciding what the rules are, which often leads to discussion of consequences for each rule.

Post reply on HN