I’ve been asked recently by a buddy who’s kid (13) wants to learn programming but isn’t sure where is best to start. My gut feeling is something like Python might make the most sense, but wanted to ask the room.
Criteria I’m working on are:
1) Ease to get to “Hello World”.
2) Kid-friendly, easily available learning resources.
3) Low setup complexity.
It’s been so long since I’ve been there (VB6!) that it’s harder to know in 2022 what the right advice to give is for someone just starting out.
I also thought about steering them to HTML first, but I don’t think the open web as the same excitement factor for someone starting out in 2022 that it did for me back in the day (which is a shame).
What do you folks think?
Lua on the Pico-8 Fantasy Console. It's easy to work with, has a built in editor, and it's very easy to make games in. I think it's a fantastic environment to learn programming with. What kid doesn't want to make a game? :)
Lazy Devs on youtube is currently producing a "Making a Shmup" tutorial that is very "from the basics" as well.
Scratch, C, Python
All 3 in that order, they don't need to go super deep on C, they can spend a couple of weeks on it - you go from programming on a very high level, to programming on a much lower level, and then to a language that takes care of lots of stuff for you (and you get to appreciate it more).
It's what CS50 does, and it's the best for complete beginners, including kids. The point is that they're learning about programming and software, they aren't learning a specifc language. I think that being exposed to more languages early helps with learning because it allows you to grasp overarching concepts instead of thinking that things are done only in the way your first language does them and then having to unlearn stuff much later on.
Our university teaches C as the first language and even first time coders manage. The problem with python and most other languages is that you'll just end up confused about references while C forces you to understand them.
Just a recently my 14 yr old brother came to me super confused about why does his python code change all the values in the list when he is only changing one, and explaining that one object "lives" in some memory space and the list just points to it multiple times is quite difficult without more low level knowledge.
I like old Basic. Weak for writing real programs in, but unsurpassed as a crash-course in how computers work.
https://archive.org/details/simple-basic/mode/2up
I think Pharo fits the bill:
1) The "Hello World" is just to type "Transcript show: 'Hello World'" in the playground, and then see it printed to the transcript window;
2) It's a Smalltalk family language, with minimalistic syntax, and a environment that makes easy to learn it by exploring, initially developed as a means to teach children;
3) It adopts a image-based development approach, so everything you need in terms of tooling is contained inside the system image, and available out-of-the-box. There's no need to set up a complex set of interlocking dependencies to get proper environment and tooling.
There's a MOOC at https://mooc.pharo.org/ and free books at https://books.pharo.org/
Squeak, the Smalltalk dialect from where Pharo was forked also would be a good alternative.
Processing. It is oriented toward graphic applications, and having quickly a visual feedback was what hooked me on programming.
The documentation is excellent and filled with examples. https://processing.org/reference
It's one IDE to install and "play" button to press to execute code. "The coding train" provides a lot of videos for beginner or intermediate programmers to learn, and Daniel Shiffman is in my opinion an excellent teacher. https://thecodingtrain.com/
I would recommend Python. If you install Thonny, you get pretty much everything you need right out of the (free) box. And because of its format, they can learn single commands in the REPL, then graduate to writing script-like programs, then progress onto increasingly complex GUI apps and whatever else they want from there, without having to change, install or update anything.
Then also if they get a Raspberry Pi Pico (which is only $4 or $5), Arduino, or just about any other microcontroller board, they're already set up to be able to control and program them, too. Lots of branching out potential, and a painless learning curve.
You could show them Lazarus, they'll see 2 way tools for creating GUIs and be spoiled for life.
Python is pretty good if they have to handle hairy data structures, or just want to use the huge selection of libraries.
From my experience creating creative code workshops for children, design students and communication students, there’s not really a "good language for beginners", there’s nice and fun starting projects and from that, the language choice can follow. JavaScript as others mentioned is not a great language for beginners… but let say the beginners are into creating art with the computer? Then playing with p5js using the online editor is a great way to have fun while coding. It’s also easy to set up and to share. Even more accessible for someone visually-oriented would be livecodelab https://livecodelab.net/, a nice introduction to thinking in terms of a main loop and in 3D. But if the beginner want to program motors, for example, then the choices would be a whole other range of language, maybe the makecode playground from Adafruit is a good start. Maybe even the Arduino IDE (!! Ouch… ) For a pure beginner, I would dare to say that the choice of first language might be inconsequential. Everything is new, and everything is fuzzy. Give them the bare minimum to achieve the first goal they have. Don’t hesitate to switch the language and tooling for the next project they want to do.
My son, also 13, just went through a program at school where they built a basic website from scratch, then did some python, then some java. They had some kind of teaching environment, a bit like a code.org or Swift Playground. When I would look over his shoulder to help, he was certainly coding an answer, but the way it was set up was so contrived that I can't really say he learned any of those languages. He learned a set of contrived functions nominally using those languages that he assembled in order to get the right answers.
I share this as preamble to why I recommend Swift Playground...it will get them going and be somewhat self directed. They will feel like they are actually achieving a goal rather than just typing text. And, if they take it to the next level they will be able to transfer their knowledge into "real" apps.
Second to this would be Python, because it's a great teaching language. That said, I think it's about the curriculum you put in front of them even more than the language.
This is timely, I just wrote about good first languages yesterday [1].
In short, Python / JS for quickest to pick up and make something cool. Rust if you’re interested in learning how computers work.
[1] https://blog.basedcount.com/choosing-your-first-language/
Consider that you can find online compilers and interpreters for many languages now, so in that regard, setup complexity would be zero.
for a kid, learning programming might be more compelling if filtered through something fun (just running code in a REPL isn't fun for most people.) I want to suggest Roblox because a lot of kids (like my nephew) apparently learn to code on that (in lua I believe) but I've also heard it's a bit exploitative. There is always also minecraft modding which I think uses java. Also Godot and GameMaker use simplistic programming languages.
Beyond that, I'd say either Javascript or Python, the first just because you need nothing more than a text editor, the second because of pygame.
Choose the best language for what the kid wants to learn.
Minecraft Education Edition - choose between Scratch, Python, and JS.
Battlesnake - any language with web server capabilities.
Electronics - C++, MicroPython, or Lua with NodeMCU
Love2d - Lua
PyGame - Python
etc.
I hesitate to recommend JS because it seems to introduce really bad habits, but it's hard to beat the feedback loop of writing code and seeing something in a web page. Lots of kids might be motivated to build an io game to share with their friends, for example -- JS on Replit or Glitch is perfect for that.
Lua is one more option to consider - simple syntax and environment like https://love2d.org/ look kid-friendly.
Autohotkey. It's also the language of choice for cheating at games (it's good for mouse clicking and button mashing) so by trying to cheat they will learn without realizing it.
On youtube, search for autohotkey and filter by new you'll see 75% of them are just that. Find a game he plays and start learning.
Very strong, very deep user community.
(FWIW, Rust seems to be a strong second. Don't know why, don't know anything about Rust).
What's the kid interested in?
Maybe there's some low-power device that would let them explore their interests, if only they could program the device.
And that would limit programming language choice to those available for the device.
The answer has been Ruby for at least 20 years now.
Python.
- Scratch
- Swift
- Python
- C[++]
- Javascript
- NetLogo (maybe)
Javascript is very handy since it's available in every browser but it's a horrible language to learn as your first. I would wait until he has an understanding of what a programming language is all about.
Go with python, it's very popular plus there are a lot of resources for it. And ultimately it's relatively easy to learn. Once he gets a handle of python then re-survey the situation and go from there.
JavaScript runs everywhere, and every web browser these days has really good JavaScript dev tools built into it (nothing to install). Python might be a bit easier in terms of syntax but if the kid has an interest in tinkering then learning how to search/parse the text of a website using the browser's Console, that can be the gateway into NodeJS programming.