3 ms·
> A friend of mine, when showing him the statement 'x = x + 1' was confused; surely, x cannot also equal x+1. Some people say a language like Haskell would be
by retrac 6y ago
> A friend of mine, when showing him the statement 'x = x + 1' was confused; surely, x cannot also equal x+1.
Some people say a language like Haskell would be no harder, and maybe even easier, for someone with no previous programming or CS experience, than something like C or Python. Comments like that make me wonder if they're right!
(Haskell is a pure functional language. And so has the same reaction as your friend. Variables are immutable. Anything else would be madness.)
- richard_todd 6y agoI guess it depends. Maybe for an adult. I learned the rudiments of Atari BASIC when I was seven and the book explained assignment with cartoon pictures of numbers going into boxes. I don’t remember ever being confused about what it meant. You could just try it (oh, X was 7 and now it’s 8, ok). Similarly, control flow wasn’t hard... just follow whichever line number to GOTO next. You could just play with it until it worked. Would seven-year-old me get very far with recursive functions and IO monads? I really don’t think so. So I’ll always have a soft spot for BASIC and how much fun it was. Maybe python in a Jupyter notebook would be a kind of similar experience for today’s kids? But not Haskell.
- fuball63 6y agoIt is interesting to try to think all the way back to the struggles of initially learning and wonder if things that seem difficult now (Haskell, which I know barely anything about) might have made more sense then. I often wonder this about TCL, which looks very weird compared to most languages but is really easy to learn if you remember the "12 rules": https://tcl.tk/man/tcl8.6/TclCmd/Tcl.htm https://tcl.tk/man/tcl8.6/TclCmd/Tcl.htm
- the_af 6y ago> Would seven-year-old me get very far with recursive functions and IO monads? A few years back, there was someone who shared here his experience teaching young kids programming with a simplified/visual Haskell and it was pretty cool. It seems kids without programming preconceptions don't find it all that difficult.