Ask HN: Best intro to programming book for 2nd graders?
So, back in the day, my parents bought a laptop, and a purple book about programming qbasic. About a year before that, my dad and I wrote a CHIP-8 program.
What good references have people found for a grade school intro to programming? The kiddo already worked through game builder garage, and is familiar with scratch.
Ideally, it would be available in dead-tree form, and assume an offline programming environment, but those aren’t hard requirements.
It doesn’t really matter if it’s a modern programming environment or not; we have dos, win 3.1, linux, etc.
22 comments
[ 2.6 ms ] story [ 65.3 ms ] threadHe also experimented alot with scratch.
Now he's 9 and learning intermediate Python through community classes taught by our area hi-schoolers.
He recently made a summer holiday project called "Story Machine" which takes 5 nouns, calls a generative AI API to create a story, uses Spacy to find nouns and randomly replaces those nouns with another set of random nouns - creating a funny story in the process. UI input using tkinter :-)
I helped him to learn concepts like API calls, JSON, generative AI, UI, event based coding etc - he google searched himself to figure out how to use those concepts.
Once you teach them the basics, they will fly!
https://pine.fm/LearnToProgram/
One thing that worked for me is to let them guide me. When they stopped being interested I'd wait a few months and try again
One tool that we found to be a very deep learning ground: an iPad app called Tynker. It is another block-based env like Scratch, though we found Tynker to have stronger primitives (e.g., you wind up forced to use globals to pass state around less often). Some big advantages: 1) iPad is super portable, so works when travelling 2) has an excellent physics engine built in - we made an Angry Birds clone 3) was strong enough to support making a piano app that can play concurrent tones. 4) Lots of samples shared by community for inspiration.
I've tried Learn to Program from PragProg and a few other books with the older kids I volunteered with and it just never stuck there was just too much of a gap there still between what they do and what they see. If you do want to go that way though then https://pragprog.com/titles/csjava2/3d-game-programming-for-... something like that but download all the code examples, show them how to run them then just let them play around with changing things and see how it changes on the screen.
Microsoft once created Small Basic [1][2], which is essentially the vintage Basic but targeting kids and education. It was updated to include a graphics interface, new modern language semantics, light OOP, and Logo-style commands. Not to be confused with Visual Basic.
When my son was 7, we went through the book "Learn to Program with Small Basic" [3] over several weeks, and he really enjoyed it. It taught him the basic concepts of variables, for-loops, control flow, etc. The language was intuitive for him to follow, and the Small Basic IDE and syntax are user-friendly and non-intrusive (especially when compared to VSCode, or services like Repl.it).
A couple of caveats to keep in mind:
1) Microsoft hasn't updated SB since 2015, so it's (was) showing its age. It appears it has been open sourced in 2019, and there are now community efforts to modernize it. This sounds great, but I haven't looked at it.
2) SB runs only on Mac and Windows. To make matters worse, the version for Mac is (was) terrible, so I ended up loading a Windows VM on a Mac host, and running SB inside it.
After that he did some more dabbling with PICO-8 and Lua (we built a Pong game together), then played with Minecraft, and eventually he moved on to other interests (music, etc).
More recently his curiosity sparked again, and now he just started learning Python using P5.js (basically Processing for Python, which offers a very visual experience out of the box).
We just started 1:1 tutoring classes using a service called Strive Math [4], and he's loving it. I found Strive Math exactly because I wanted someone who used P5 and offered a more visual learning experience, and that's exactly what these folks do. Still early, but early results are very promising.
[1] https://en.wikipedia.org/wiki/Microsoft_Small_Basic
[2] https://smallbasic-publicwebsite.azurewebsites.net/
[3] https://www.amazon.com/gp/product/1593277024/
[4] https://www.strivemath.com/
Yes, QBASIC. Back to the 1990s. DOSBox or something similar needed for it to work under Windows 10. But: the syntax is easy to grasp even for children who are not native English speakers, and the full-screen IDE with Large Friendly Letters On A Blue Screen seems to help the kids in maintaining focus. Modify your code, hit F5, repeat (infinite LOOPs under DOSBox may be "fun", though, since the program termination hotkey is tricky to figure out).
For teaching/learning the absolute basics of programming, QBASIC still seems well worth considering.
Going through this book with my son just these days, and I think he's doing great. It's a really well written book, too. Careful wording, empathetic towards the child-learner. A prime example of "new is not always better".
When we're done with the introductory book, we'll probably move foward to "Sprites in QBASIC" by the same author: http://tedfelix.com/qbasic/sprites.html
"Invent Your Own Computer Games with Python, 4th Edition."
https://inventwithpython.com/invent4thed/
I feel like it has been going pretty well so far.
I have taught Scratch to different grades at my kids school. I have found third grade to just barely grasp Scratch.
ScratchJr on the other hand can be picked up by kids as young as 4 but ideally at 5.
I have a whole curriculum designed around it that pushes the boundaries of what you can do with it.
Mainly I give this recommendation based on the practicality of the material and straightforward style. You don’t necessarily need to be a biologist to get a lot out of it, same stuff is used everywhere anyway. Combine that book with the Pythonista app on a phone and you can just whip out your mobile device and instantly have a better equivalent to a TI-83 calculator, with internet.