Readit News logoReadit News
Posted by u/slyrus 3 years ago
Ask HN: It's 2022. Where should I direct the youths to learn about programming?
So... Child #2 (18 yo) is interested in learning programming. Good "with computers" and proficient in level-appropriate math but didn't grow up as a hacker like his old man (I'll refrain from making him learn turtle graphics and BASIC). Where should I point the kid to learn the basics?

I'm afraid that if I show him how to download (or, better yet, build) emacs, how to build SBCL, install SLIME, etc... and hand the kid copies of SICL and PCL someone will call child protective services on me. I imagine there was a time when the answer would have been java/awt, but those days seem long gone. Maybe there was a let's do it all in javascript phase, but that doesn't seem to be the answer today.

So... modern starter pack? VS Code and Python? Tell him to learn Pandas/SciPy/NumPy?

Are there any highly recommended online courses for learning this stuff?

albertzeyer · 3 years ago
I usually recommend everyone who wants to learn programming:

- to write some games,

- or alternative to write some tools to be used for themselves to automate or simplify some of their tasks.

Writing games can be so much fun, and is incredibly deep such that you can pretty much touch upon all topics of programming, networking, computer science, algorithms and data structures, artificial intelligence, 3D graphics, GPU programming, low level programming, multi threading, etc. But also, you can start very shallowly and simply.

Writing tools gives you the feeling how useful and productive this can be.

What languages to use depends a bit on taste, background knowledge, and how steep the learning curve can be. I think Python is a good general purpose starting language.

Also, in any case, you should start actively coding right away. I know people who wanted to learn programming but just kept reading books and watching tutorial videos all the time while not really trying it out, and in the end they obviously did never really learn it. You need to have projects, or just random playgrounds. Also, don't start with a big project right away. Do many small projects. Play around.

TobTobXX · 3 years ago
Yes, agree about the last paragraph 100%. I'm only 19 and got into programming maybe 7 years ago. At the time I was gifted a Raspbery Pi. Next to the infamous Scratch, there were about 10 pygame examples. I got the itch to modify them. Trough trial and error I somehow found the source files and I just started removing code and changing numbers. At some point I started copying lines I've seen and recomposing them.

As I wasn't allowed to just go on the internet (yet), some time later I also got a CS book. By studying that, I finally was able to "program" what you would call it.

I agree all the way: Don't read about programming. IMHO, taking a (veeery easy, in my case it was Super Simon in ~200L Python) program, game if you wish, and starting to just change stuff around. This gets you comfortable with the concept of coding. "Formal" education (ie. books etc.) are only required once you already are fascinated.

This is the advantage of the young: They are not afraid to try out and break things. I'd suggest using this phase of life as it is intended.

xxxtentachyon · 3 years ago
Can you say more about not being allowed on the internet? Why and how you think it affected you?

It’s hard for me to fathom someone at age 12 in 2015 with a somewhat cosmopolitan background (playing games, using an RPi), not being allowed on the internet, period.

armchairhacker · 3 years ago
> to write some games,

> or alternative to write some tools to be used for themselves to automate or simplify some of their tasks.

This is exactly how I learned programming as a kid.

The one difference I would recommend is to not focus on 3D, low-level programming, AI, data structures, etc. at least for younger children. When I was a kid these things confused me (I specifically remember getting random memory management issues and confusing EXC_BAD_ACCESS, and generally resorted to just liberally retaining everything). I just wanted to make things and got bored easily, so I accomplished most making simple projects on Scratch (very basic game-engine) and high-level IDEs.

Of course ultimately it's up to the kid what they want though. If they're more interested in the low-level mechanics and how things actually work than just getting them to work, good for them.

coderdd · 3 years ago
Tic80.com - might overgrow it quickly, but excellent for start. Has Lua, Fennel.
corysama · 3 years ago
officehero · 3 years ago
What about playing a game about learning to code instead of writing a game? I spent a few days on codecombat.com as a beginner and thought it was both a great learning experience and an entertaining game.
rich_sasha · 3 years ago
One of my programming starts was Delphi. Pascal is an easy language, but has some fundamental features: pointers, classes, procedures, custom types, manual memory management on heap and so on (it was devised as a teaching language IIRC). Delphi provided a GUI builder and a rich library which made it all fun and visual; you could whip out a first “program” or “game” in no time.

Delphi is no more but there is some successor, seems to be well received on HN.

tootie · 3 years ago
https://24a2.routley.io/

This is the most basic of javascript game engines but also challenges you to be creative.

empressplay · 3 years ago
turtleSpaces is a 3D Logo environment that allows fit pretty straightforward creation of simple 2D and 3D games in the browser using turtles and can provide a bridge between Scratch and Python https://turtleSpaces.org
treetide · 3 years ago
Loose connection, but made me remember https://code.world/ uses a Haskell-like functional language to define still pictures, animations, or even games.
sefrost · 3 years ago
XNA was great for this.
guilherme-puida · 3 years ago
Monogame (https://www.monogame.net/about/) is nice too.
mkeedlinger · 3 years ago
I can't believe https://futurecoder.io/ hasn't been mentioned!

It has an integrated Python environment in the browser, so the learner can hop right in! That's not even the best part though; I love how well simple concepts are explained. I've been programming for a long time, so there are a lot of things that I forgot aren't a given. futurecoder explains those things really well.

I really cannot recommend it enough! It is a bit pricey though.. JK it's FREE! They don't push it a lot, but they do have an opencollective if you should feel so inclined to donate [0]. I'm not affiliated; just a relative of someone who benefited.

[0] https://opencollective.com/futurecoder

terrycody · 3 years ago
marked
shmageggy · 3 years ago
If you click the "X hours ago" next to the poster's username, you should see a link to "favorite" the post.
_fjb4 · 3 years ago
There's something the "old hackers" know that many CS students don't learn from the start (in the introductory classes), and that is actually how a computer operates. Don't spend a lot of time on this unless he's really interested, but it's a good idea to sit down with him for a few hours and teach him what really goes on inside a computer.

I'm talking about the concept of instructions, registers, addressable memory, etc. - with block diagrams, not with full circuits unless he's into that kind of stuff.

Then when he moves onto one of the high level languages that the other commenters are talking about the concepts will naturally stick. E.g. a variable is stored in memory, when we add two variables in the HLL we are copying those values to registers and using an ADD instruction, then we are writing the result back to memory. When there is an IF statement the computer will jump to either block of code depending on the conditional operation. Pointers become intuitive. And so on.

I've explained this to laymen and people who are interested in computers and have gotten a pretty positive reaction from them - so it's worth a shot. For a programmer who generally focuses on HLL it also allows them to get some idea of how their code is executed in the real world under all that abstraction.

sacrosancty · 3 years ago
It depends if his motivation is to build something or to learn stuff. Personally, when I was that age, I couldn't care less about learning anything unless it directly helped me achieve my immediate goals of whatever I was building. Turned out that was quite a lot. I learned about registers because I had to to optimize part of a game I was making. I wouldn't have sat down and studied some dry theoretical crap just for the sake of it. Block diagrams were a strong turn-off because you knew there would be no actionable information in them. Why do I care how this unit is connected to that unit? I just want to use the units! I'd naturally infer the structure of things once I was using them.
aleksiy123 · 3 years ago
What formal CS education doesn't cover how computers work at a low level? It would seem like the opposite. Most self-taught programmers are probably missing foundational knowledge that doesn't directly apply to their day to day.
Jtsummers · 3 years ago
Every CS program of middling quality or above covers that material, but some may shove that coursework into mostly elective courses. Also, students can pass courses without really learning anything so if it's just one or two courses that really dive that deep over their academic career, they can learn enough to pass and then brain dump it.
esalman · 3 years ago
I have met more CS graduates who have little clue what's going on beyond what they copy pasted from stackoverflow compared to those who do. Both in the Indian subcontinent and right here in the US. Self-taught folks actually have the capacity to research and teach themselves what's going on under the hood.
colinmhayes · 3 years ago
Well it was the fifth course in my departments sequence, so a lot of students wouldn't take it until junior year. By that time they were decently proficient at writing code.
beebmam · 3 years ago
That's what I learned in CS, along with many other topics.

There's no way in hell I would learn about registers or assembly languages if I was learning about programming in 2022 outside of a CS program.

BenjiWiebe · 3 years ago
You'd have a good chance of being exposed to it if you wanted to mess around with microcontrollers, like for robotics, sensors, automation, etc.
Shared404 · 3 years ago
I highly recommend "The Secret Life of Programs" for this purpose.

It starts at the hardware level and works up - it definitely massively improved my understanding of everything that goes on in a machine.

sudosysgen · 3 years ago
It's a first year CS assignment in my university to modify the VHDL source of a MIPS CPU to add an instruction as well as to program in assembly. It's not that uncommon either.
digitallyfree · 3 years ago
This is actually quite interesting, as this seems like something that would be taught in a CE curriculum as opposed to being in a first-year CS course. From the people I know who studied CS they may have exposure to HDL and digital logic in the upper years if they say elected to take a computer archicture course, but their introductory courses mostly focused on programming and algorithms.

I guess it really depends on the school - I have a EE/CE background so I know these things, but the CS people I know mostly don't.

gandalfff · 3 years ago
Non-programmer here. I've been interested in learning more about exactly this. Where should I start?
DashAnimal · 3 years ago
I would recommend the book "Inside the Machine" by Jon Stokes. I'm a programmer so not going in with fresh eyes necessarily, but it definitely felt like it began at the start and the author was a tech journalist for Ars Technica (with a Computer Systems background) - I think it does a really good job. It also happens to be one of my favorite books, especially if you're interested in older hardware.
fy20 · 3 years ago
When I was a kid I'd often spend an evening on a deep dive reading How Stuff Works (as Wikipedia didn't exist then).

https://computer.howstuffworks.com/microprocessor.htm

kwhitefoot · 3 years ago
First find a small problem that you would like to solve then search for a programming solution.
redredrobot · 3 years ago
Python is a great option because it is high-level, easy to pick up, powerful and has a library for anything they are interested in pursuing. Something like streamlit is cool because you can write a small amount of code to build a useful web app that you can interact with. For data viz related things, Jupyter + Python (maybe Pandas, not SciPy or NumPy unless that sort of math is specifically interesting to them)

Javascript and webdev is also a decent option since you can build such interesting and shareable web apps quickly, but the frameworks and scaffolding can be intimidating and painful.

I would work backwards from a project/interest and pick a high-level language where it's easy to get a good enough solution and create something that feels like an accomplishment. I would want to teach both programming as well as the joy of programming.

lolinder · 3 years ago
> Javascript and webdev is also a decent option since you can build such interesting and shareable web apps quickly, but the frameworks and scaffolding can be intimidating and painful.

JavaScript can be a great choice for some people as long as you don't try to build a production-level web app from the get go. Start them with a bare HTML file loaded up in the browser and only scale up from there when they start actually having the problems that the scaffolding is designed to solve.

Deleted Comment

bmitc · 3 years ago
I believe there are plenty of languages better than Python to start programming. Python provides zero interesting or unique ways to look at the world. It's like starting to teach dance with TikTok dances.
matyasrichter · 3 years ago
Even if that was the case, it might actually be desirable. I think you can't appreciate the uniqueness in the other cases if you haven't met the general purpose mainstream.
antifa · 3 years ago
Dance is such a broad topic... why not start the youth with "TikTok dances"?
arturhoo · 3 years ago
I highly recommend Processing and The Coding Train [0]. The visual feedback is both engaging and illuminating to folks who have no prior experience with procedures or spreadsheets.

[0] https://youtube.com/c/TheCodingTrain

duck · 3 years ago
Just to add to this great recommendation, https://p5js.org/ (JS port of Processing) is really great as they can get started right away and the docs are super simple. Dan uses it in most of his videos and really starts at a basic level, but works up to really complex concepts as well. My kids are younger, but they like the graphical part of it way more than me showing them the terminal and Ruby.
SCUSKU · 3 years ago
Speaking from own personal experience, I tried to learn programming by buying a book on Ruby on Rails in 9th grade, as well as Visual Basic. Obviously it didn't stick. I programmed turtles in middle school, and took a intro to CS class in high school.

But what really did it for me was buying an Arduino Starter Kit and working through the example projects in that book. I was a freshman in college and $100 was a lot of money for me but I told myself it was an investment in myself, and boy was I right. It was also immensely fun because you get to also interact with a physical object (circuits, buttons, etc) whereas most software is on a screen.

I would highly recommend Arduino or Raspberry Pi :) Best of luck!

khadgar25 · 3 years ago
Perhaps approaching from the point of view of programming as a means to end might be helpful? If they have any hobbies or academic projects that could benefit from automation or using computers, that might be a good starting point?

For example, when I started studying engineering, it was great to see solutions of differential equations and ways to solve them on computers. Others have suggested games which could be great if they enjoy gaming and want to know more behind the scenes. Basically my approach would be to find a problem or two and use programming to show that computers can do wonderful things once we learn how to interact with them in various ways.

Snowworm · 3 years ago
Yes, I completely agree. One thing I'll add as an example; I used programming as a way to learn about mathematical concepts too. I made a program to render an image of the Mandelbrot set, which helped me learn both some new things in JavaScript (what I was using) and mathematics (complex numbers and limits). You'll probably be able to find a similar sort of project for your son.
taurath · 3 years ago
> Maybe there was a let's do it all in javascript phase, but that doesn't seem to be the answer today.

Whats the child's actual goal though? Is it to be able to gain a useful workplace skill that will actually provide financial support for their lives (something that their peers who don't end up in tech will struggle with heavily)? If so web dev is honestly a really good path, and quite useful, and will touch on things they already know.

If they're a gamer see if they can make some mods - minecraft is good for it, but the best one is something they're already into.

If they care deeply about some world issue like say climate change, try to have him make some visualizations and do some data science on climate data to understand whats going on.

What you do with coding is imo a bit more important than how you code. Does the kid want to take apart toasters and put them back together again? What actually motivates them?