News for hackers. Stuff that matters.
Re:If monads are the solution, what is the problem? by tathougies on Tuesday July 31, 2018 @10:34AM (#17653469)
I’m not a psychologist. I can’t talk about most people. I do not. I break problems down into sub problems and then think of how to combine results to achieve the answer. I repeat this until my subproblem is trivial. This lends well to the compositional approach of functional languages. Imperative languages require taking the extra step of scheduling. I think many people think like me but due to the prevalence of imperative languages, do not pursue cs.
Re:If monads are the solution, what is the problem? by magicalhippo on Tuesday July 31, 2018 @04:42PM (#17656902)
Well, scheduling is important. I can't connect my new phone to the computer until I've taken it out of the box it came in.

It feels like I'm leaning to the imperative side. When breaking down the problem into substeps, I'm already thinking about the sequencing which will later dictate the scheduling.

I've been teaching Scratch[1] to 11-13 year olds for a few years now, and most seem to pick it up pretty quick. However a few struggle (while still being motivated enough to keep trying). Would be interesting to see how it went with a functional Scratch version.

[1]: https://scratch.mit.edu/

Re:If monads are the solution, what is the problem? by lmm on Wednesday August 01, 2018 @04:29AM (#17660558)
> Well, scheduling is important. I can't connect my new phone to the computer until I've taken it out of the box it came in.

That's not scheduling, that's a data dependency which functional style handles very well. Imperative would be more like deciding you have to unpack the charger and then unpack the phone and then charge the phone, when in fact it's fine to unpack them in either order. http://www.lihaoyi.com/post/WhatsFunctionalProgrammingAllAbo... has an extended example.

Re:If monads are the solution, what is the problem? by magicalhippo on Wednesday August 01, 2018 @09:06AM (#17662094)
Good point, thanks for the correction.
Re:If monads are the solution, what is the problem? by tathougies on Wednesday August 01, 2018 @03:08PM (#17665883)
I think codeworld is a more functional alternative to scratch, although much less drag and drop. Check it out.. It's pretty fun! https://code.world/