Live data from Hacker News

Conversations with a six-year-old on functional programming

byorgey.wordpress.com

81–90 of 319 posts

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

#81
post #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…

His code is also impeccable. Diagrams [0] is a pleasure to read.

[0] https://hackage.haskell.org/package/diagrams

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

#82
post #73

Earlier quoted context omitted.

A function with a linear type uses it's parameters exactly once. The concept of "linear type" doesn't relate to a the concept of "linear function" except in an abstract mathematical way.

Well, a linear function is a function where you can only use the parameter once when expressed in its Taylor expansion. E.g. these are not linear: x^2=x*x (used twice), exp(x)=1+x+... (used infinite times). It’s a very symbolic way of thinking about it though, and not what you usually consider an important property of linearity.

Not all linear functions possess a Taylor expansion, as not all linear functions are continuous, example: https://en.wikipedia.org/wiki/Discontinuous_linear_map

But, your statement is true for all real-valued linear functions AFAIK.

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

#83
This game can be played in a group, too: https://en.wikipedia.org/wiki/Zendo_(game)

> once the guesser thinks they know what the function does, the players switch roles and the person who came up with function specifies some inputs in order to test whether the guesser is able to produce the correct outputs.

In Zendo when the guesser offers the wrong rule, the 'master' must tell them an (input,output) pair where the guess disagrees with the rule the master had in mind. Then play continues.

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

#84
post #46

Earlier quoted context omitted.

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.

Familiar? Seriously?!? That syntax is not familiar to non-programmers. > Math should be taught in prefix notation if u ask me. Perhaps it should, but it's not. Or was this whole post sarcasm, and it was done so well that I missed it?

There must be a name for that, when someone casually says something is simple when it is in fact a very complicated subject.

EDIT: After some googling, TIL humblebragging.

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

#86
post #75

Functions? Algebra? How is comprehending any of that, possible without the sort of abstract/counterfactual thinking that develops around age 12?

Counterfactual reasoning is a subset of abstract reasoning which is a subset of abstract thinking more generally. Children are capable of abstract thinking (e.g. pretend play) and even abstract reasoning (e.g. basic conditional reasoning) very early on. I haven't studied this field (though my spouse has), but a cursory reading of this paper shed light on the distinctions: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3582172/

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

#87
post #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.

No. Children like to copy their parents, and want to learn about what they do. If a six year old wanted to play frisbee, he probably would have asked to play frisbee. At the very least he would've made his boredom clear pretty quickly. Yes, he wanted attention from his dad, but best of all was being able to learn about dad's grown up stuff by doing something they both enjoyed.

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

#88
post #75

Functions? Algebra? How is comprehending any of that, possible without the sort of abstract/counterfactual thinking that develops around age 12?

Don't underestimate how big a difference is made by actually being interested, not worrying about how you'll look to the other kids in class, etc.

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

#89
post #80
post #75

Functions? Algebra? How is comprehending any of that, possible without the sort of abstract/counterfactual thinking that develops around age 12?

...who told you that lie? An educational psychologist? More like "at age 12 even the most incompetent teacher can teach things involving abstract/counterfactual thinking to even the least intelligent child"... the bad ol' "lowest common denominator thinking" and the other horrors of our standardized educational systems :| Unfortunately it's not economically feasible to lecture to children in a classroom unless you ca…

> ...who told you that lie? An educational psychologist?

https://en.wikipedia.org/wiki/Piaget%27s_theory_of_cognitive...

Fine, I was off by one year.

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

#90

I had a somewhat similar encounter with a 4 year old (!), who blew me away with his ability to solve arithmetic puzzles: http://heinrichhartmann.com/blog/2016/06/12/Box-Counting-Ari... It's a great joy to work with such gifted young minds.

Such precociousness is often[1] an indicator of abnormalities and handicapped general intelligence. For example, if our son independently began to read too early the initial reaction of my spouse, a Speech-Language Pathologist, would be to freak out rather than to be filled with pride.

Perhaps you know this and used "gifted" in its more euphemistic sense. In any event, I mention this not to correct you but to address the parental anxiety engendered by examples such as you gave.

[1] Depending on the activity and age of onset, they can be so strongly correlated that attentive educational professionals would recommend diagnostic tests to identify any condition (often some category of autism) and permit early intervention to minimize the negative developmental aspects.

Post reply on HN