Hacker News Re-Imagined

Ask HN: What programming language should I teach my child?

Should I start them off with js, since they can get quick feedback and interactivity in the browser? Or should I start with rust, since that will teach them more about how computers work on a fundamental level?

  • 7 points
  • • 2 days ago

  • @machinerychorus
  • Created a post

Ask HN: What programming language should I teach my child?

@8b16380d • 1 day

Replying to @machinerychorus 🎙



@jguzmanjr • 2 days

Depending on the age, block based visual programming to create 3D worlds might pique her interest: https://www.alice.org/


@Minor49er • 2 days

You should definitely focus on quick feedback early on to get some basics about programming down. The specifics can come later. I would recommend something even simpler than JS or Rust at first, like Scratch, FreeBASIC, or PICO-8 (PICO-8 is $15, but may be well worth it)

https://scratch.mit.edu/ https://www.freebasic.net/ https://www.lexaloffle.com/dl/docs/pico-8_manual.html


@Hec8 • 2 days

Personally, I started on Khan Academy's coding lessons. They teach Processing JS iirc. I don't think it really matters what you teach them first, but definitely have it be something that allows them to draw and move shapes. I think that's what motivates many early programmers.


@mettamage • 2 days

I would go with JS, HTML, CSS. You can create games with it easily.


@u2077 • 2 days

Start with rust so they can get front page on HN. - Jokes aside, Free Code Camp[0] is a great resource for beginners and will help them learn basic concepts without block coding.

I would say quick feedback is important to make the learning rewarding and fun.

[0] https://www.freecodecamp.org/learn/


How old is your child? If they're between 10 and 14 years old you can teach them Hedy (hedycode.com) ! A gradual programming language that's easy to learn and transpiles to python!


@ModernMech • 2 days

Depends on how young. Logo if they're in elementary school; it was designed for children of that age. A large number the students I teach started with Logo as children and went on to learn other languages.


@karmakaze • 2 days

Historically, I would have suggested starting with lower-level languages such as C and a bit of assembly, then building up from there as the added expressiveness is much appreciated and understandably less direct. This all made sense when hardware was many orders of magnitude slower than it is now, even a phone running on a battery is more powerful than workstations of those days.

I would say the question isn't exactly which language to learn first, but rather which programming style. After a long career developing software, my opinion for new developers is to learn programming in a functional style. Not necessarily with a proper functional language, but one where it's natural to use immutable datastructures, only assign to local variables once per scope, and for longevity support concurrency. One element that could be deferred until later is static typing. Another important element is that there shouldn't be a main concept of fine-grained execution steps. By this I mean the typical for-loop or iteration variables. This whole premise is forcing humans to 'play computer'. We have powerful computers now, we can have computers, 'play logic' at a higher level without thinking in what amounts to be higher-level-machine language. A good example is using map/reduce/takeWhile/etc forms rather than for/if constructs. With those we can write one-liners that are one-level higher replacing entire block-control structures, and they can be chained on the same one-line, or over multiple lines in a flat, not nested structure.

The great thing about thinking this way, is that you can apply the same thinking and writing even when using procedural languages resulting in cleaner code without off-by-one and other edge case errors. Two languages that could fit this bill and be relatively mainstream are Elixir and Clojure. I think Elixir would be a great choice, as it together with the Phoenix framework is a reimagining of Ruby/Rails. Clojure is fundamentally small, but its usage can quickly become esoteric.

I also wouldn't go heavy on the js/css and learn just enough to get stuff done. When ready try to get exposed to using static types via TypeScript or a functional language like F# to see what they're about. Java, Kotlin, or Dart (with Flutter) might also be good mainstream choices but they tend to be less functional. You can try but the ecosystem (especially jvm) tends toward more OO and mutable data/state.

One completely different good candidate is Go. It has static types, is lowish-level like a C of today with garbage collection. There isn't a full framework though so you'd be pulling together a collection of libraries to make a web app. Having something opinionated leaves you with fewer questions when starting out. Still great if making command-line utilities, networking, or text (not graphical) apps is of interest.


@mixmastamyk • 2 days

I'd recommend starting with Scratch, then moving on to Python with Thonny.

Turtle is a fun thing to work with. https://docs.python.org/3/library/turtle.html

Would avoid anything tedious, learning it all is hard enough already.


@Maursault • 16 hours

If you have to do this, which you really don't, but if you do, start with cooking recipes, move on to algorithms, and the pseudocode. That is all.

Guys always get the family wrong. Always. The father's task is not to raise and edify the child. Your task is only to support your wife and the mother of your children. Bonus points for loving your children. But let them do whatever the heck they want, and keep your mouth shut, because it isn't your problem and it isn't your job. Your problem is your wife. Other than providing for your family and doing your husbandly duties, you can change the oil, pay the bills, and keep the house secure and energy efficient. It's when people overreach that problems occur. If everyone would just do their jobs, things would be fine. But instead we have OCD control freak fathers that want to live their children's lives for them. Back off before you do serious damage, and just be happy, and if you can't, maybe talk to a psychologist once a month.


About Us

site design / logo © 2022 Box Piper