Live data from Hacker News

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

byorgey.wordpress.com

151–160 of 161 posts

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

#151
post #50

Earlier quoted context omitted.

I sure hope the haircut function mutates it's input, and doesn't return a clone whose hair is cut.

Reminds me of a YouTube video which said every time someone gets beamed in Star Trek they are killed and someone else is created with their body and mind somehow. If that were possible, why wouldn’t they just store backups and “restore” from backup when someone died?

This is something that is addressed in the show! Pulling all my knowledge from just TOS and TNG;

There are 3 broad cases:

1. Something goes wrong during transport and the person cannot be rematerialised. Typically they end up "stuck" in the pattern buffer of the transporter. Some fiddling and plot tension allows them to complete transport by the end of the episode

2. A partial transport leaves some part of the person behind. This is where you can end up with weird things like piles of sludge on each end, or evil doppelgängers who are mostly the same, but only some features were transported

3. Unknown phenomenon that creates a duplicate. The original has general "failed to transport" experience, while the clone has a complete experience and is so none the wiser that "they" also got left behind.

From this we know that the pattern buffers can absolutely be used to store "backups". This is even discussed at some points after a crew member unexpectedly dies. However what complicates matters is that typically the patterns rapidly lose coherence in the buffers. Whether this happens immediately or after many years is left up to the plot requirements. Generally it seems that unused transporters will hold the last pattern they transported as long as their power supply is stable and are not travelling through space. Anything involving warp, fluctuating power, or transporting other people immediately clears the buffers (and can even cause transporter failures)

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

#152
post #139

Earlier quoted context omitted.

Oh, no question about that. When I was a kid, I tended to assume that my parents always were available to drop what they're doing and engage with you. (And which, incidentally, is surely a reason why many parents are finding working from home during quarantine to be so difficult.)

Your question may have touched a nerve, if he was getting older and no longer could see sharp.

Maybe he was like me who had some degree of hearing loss when I grew older and could no longer hear C sharp.

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

#153
post #139

Earlier quoted context omitted.

Your question may have touched a nerve, if he was getting older and no longer could see sharp.

Maybe he was like me who had some degree of hearing loss when I grew older and could no longer hear C sharp.

musical notes repeat once every doubling of frequencies, so there are many C#s spread throughout the range of human hearing. The only way someone could be unable to hear c# would be if they were unable to hear at all.

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

#154

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 thi…

The way maths is taught in Australia, for a long time the term function was synonymous with the concept "2D plot that passes the vertical line test" in my mind. I was completely unaware of how much broader and more interesting a concept functions are. There are probably many people whose understanding never progresses beyond this, which I think this is extremely unfortunate.

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

#155

Earlier quoted context omitted.

Maybe he was like me who had some degree of hearing loss when I grew older and could no longer hear C sharp.

musical notes repeat once every doubling of frequencies, so there are many C#s spread throughout the range of human hearing. The only way someone could be unable to hear c# would be if they were unable to hear at all.

Your parent and grandparent comments were (imo, clever) word plays on C# / see sharp and back to _hear_ c# (instead of see sharp).

Edit: Point being--scientific accuracy not required. :)

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

#156

I was 16 and learning FORTRAN at school. I was a lazy bum at that time (well, that stayed ;-), didn't really prepare, and at the final exam, the teacher asked me in what order the program is executed. Not knowing any better I replied "a value is calculated when the rest of the code needs it" (like in regular math that we did a lot at the time too). She said "not correct, it executes in the order it is written". -- I…

It looks like you projected your own laziness onto the language.

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

#157
post #64

I see a lot of articles that try to make FP look really easy. The majority of programmers have a lot of trouble figuring out how to figure out a typical FP program with its layers of nested functions. It isn't easy, which is why most code bases are not FP.

You should watch Rich Hickey's "Simple made easy", to understand why "easy" is almost never better than "simple". FP programs are almost always simpler than similar OOP programs.

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

#158
post #18

Surprising because I have seen few 6 years olds can do multiplications and divisions. If I'm not mistaken, standard US 1st grade curriculum expects kids to be familier with only addition below 100 and subtraction in low teens.

My kid took an evaluation test in elementary school to see what they already knew. He hadn't been taught long division yet, but when he was presented with the problem he figured it out on the spot. The teacher thought that was remarkable enough to bring to my wife's attention.

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

#159

Earlier quoted context omitted.

musical notes repeat once every doubling of frequencies, so there are many C#s spread throughout the range of human hearing. The only way someone could be unable to hear c# would be if they were unable to hear at all.

Your parent and grandparent comments were (imo, clever) word plays on C# / see sharp and back to _hear_ c# (instead of see sharp). Edit: Point being--scientific accuracy not required. :)

oops!

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

#160
post #47

"He gasped in astonishment at the idea of putting function machines into function machines" "He gasped in astonishment as I carefully explained the results of the double-slit experiment." Surely more like that this describes a 6yo kid being excited about something their parent is excited about and a product of implicit empathy, than any significant insight? I hate to lose reputation with downvotes for sounding negati…

Either that or this is a blog post about `Things that didn't happen.`. If OP is claiming a 6 years old understands what `He gasped in astonishment at the idea of putting function machines into function machines` means then he is lying.

Nothing ever happens. Everything is fake. People regularly lie about even the most banal things because everyone is a compulsive liar.

Is this really the worldview you choose to have?

Post reply on HN