4 ms·
How I wish these "for children" programming languages were more focused on functional programming, rather than being so imperative.
by sssilver 3y ago
How I wish these "for children" programming languages were more focused on functional programming, rather than being so imperative.
- csmeyer 3y agoFunctions are at least first class! We have map and filter on lists, for example. I'd love to add some more advanced curriculum that focuses on teaching a more functional style.
- pamelafox 3y agoIf you want inspiration, we created a (mostly) functional-first curriculum for Snap (like SCRATCH) which still has highly visual output. https://bjc.berkeley.edu/bjc-r/course/sparks.html https://bjc.berkeley.edu/bjc-r/course/sparks.html It's definitely trickier to bring functional programming into these sorts of environments, but I think we came up with some nice compromises there.
- benrutter 3y agoI dunno, I think teaching functional programming to kids is an awesome goal, but at the same time most "real programming" they'll move on to (javascript, python etc) is going to be imperative. It's probably a better learning experience for kids to be able to get to a point where they can make fun things like games and websites, and then teach them how to improve the correctness of programs. (Obviously there are some great options for functional creation like elm, but there obviously isnt the same level of available learning resources yet)
- hnlmorg 3y agoThis is the first time I’ve seen JavaScript not being described as a functional language :) As for your more general point: it’s easy to go from functional -> imperative. It’s a lot harder to do the same thing in reverse. Source: anyone who learned LOGO before BASIC in the 1980s.
- deleted 3y ago[deleted]
- lolinder 3y agoIt's funny that you and a sibling have essentially opposite asks [0]. The other commenter's anecdote is about how even the magic of expressions resolving to values goes over some novices' heads— how much more so would a full expression-oriented language! I'm a fan of functional programming, but I also sympathize with OP's observation that even python might be too far from the CPU to be a good introduction to computing. It probably depends a lot on the child and the teacher—a functional programming language would probably appeal more to older kids (high school) who are comfortable with math. [0] https://news.ycombinator.com/item?id=38366268 https://news.ycombinator.com/item?id=38366268
- indigochill 3y ago> even python might be too far from the CPU to be a good introduction to computing IMO Python is useful as a didactic tool not so much for teaching kids how computers work as for giving them an emotional experience of "Wow, I can make the computer do things! I'm basically a wizard!" that then might motivate some of them to keep learning about computing. But yeah, there will also be kids who are already well past that stage and ready for meatier stuff. So probably a combination of approaches is best to provide kids with the level of detail they'll find most engaging. Anecdotally, I grew up on Logo, Lego Mindstorms, and HTML, and got my early career started in Python before I really dug in and learned about how hardware makes the magic happen because I realized I was going to be handicapped until I knew that.
- hutzlibu 3y ago"It's funny that you and a sibling have essentially opposite asks" Trying to please everyone is the road to madness, while acomplishing nothing.
- george_____t 3y ago> even python might be too far from the CPU to be a good introduction to computing That depends on what one considers to be the best way to introduce computing. I personally think kids are a lot less likely to be engaged by a bottom-up approach (start with "this is what hardware does") than a top-down approach (start with "you can make cool things with it").
- bittwiddle 3y agoI built a game you might find interesting. It's basically a visual Lisp wrapped up in the idea of arranging magical cards to build spells. https://www.bittwiddlegames.com/lambda-spellcrafting-academy/ https://www.bittwiddlegames.com/lambda-spellcrafting-academy... The demo is playable in the browser too thanks to Rust + WASM.
- esafak 3y agoHow would that help children? You want to make it easy to get into. I think imperative is simpler than functional. Let them learn to crawl first.
- sidlls 3y agoIt depends on the complexity of the program/problem being solved. I think it’s conceptually simpler, for example, to demonstrate how a function that can’t have side-effects works than one that doesn’t by pure “accident”. The real trouble is when you want the program to do anything actually useful, like interact with anything (input/output). And since that’s where the vast majority of programming is spent, I tend to agree that imperative first is a better approach.
- dndn1 3y agoI agree. Functional programming sits on a difficulty range: spreadsheets on the low-end (debatable but I'll say it!), and on the high-end, well, I think that everything else FP sits there with minor exceptions. I'm developing a language for numbers that is conceptually closer to spreadsheet formulae than imperative programming or hard-FP, therefore I think hopeful for this kind of task in the long-run. It's "only for numbers", so really think spreadsheet-formula type complexity, but I won't stop anybody from going wild with interpretation. To see things you pair it with some other language like JS, but code for these "apps" can be simple/declarative and pre-rolled. I have a JS visualization library that will probably be graphical one day. I'm working on the project website [1]. Following spreadsheet fashion some examples are a little bore, but there is a raycaster rendering to a bar chart and heart shapes, bouncing balls and projectiles, to lighten the mood for early developer-adopters or contributors. For some more project background: by encapsulating numbers in a language (and not a mad one and one that we can safely and actually run), it can facilitate transparency for numbers. Transparency and education go hand-in-hand. I'm talking about numerical literacy primarily, but I think that too goes hand-in-hand with.. programming on computers. [1] https://calculang-quarto-site-messing.pages.dev/examples https://calculang-quarto-site-messing.pages.dev/examples