Hi all,

My 8 year old is asking if he can learn how to program. He has asked specifically if I could set him up with a ‘programming kit with lessons’ for a Christmas present. I’d like to support this, and it seems like it’s not a transient interest as he’s been all over scratch, and using things like minecraft commands for the last year. I have an old (pre 2017) MacBook Air I can set up for this. How do I / what would you advise I set up for him, to a) keep him safe online (he’s 8!) and b) give him the tools he needs in a structured way.

I am not a programmer. I know enough bash/shell and basic unix stuff to be dangerous and I was a front end dev a very long time ago, but I wouldn’t call myself a programmer and don’t know what concepts he needs to learn first.

Hugely appreciate any advice, thanks.

Edit: So I posted this then had a busy family day and came back to so many comments! I will methodically go through these all, thanks so much.

A couple of things on resources: he has expressed interest in 3D worlds and I noticed comments on engines, but wonder if that’s too advanced?

Totally agree with the short feedback loop rather than projects that take days.

He has an iPad 6 and I’m happy to pop a Linux distro on the Air, so certainly open to that.

So many links to research. Hugely grateful.

  • jet@hackertalks.com
    link
    fedilink
    English
    arrow-up
    69
    ·
    1 year ago

    Everyone else’s suggestions are great.

    Get them a copy of Factorio, it’s a game, but it’s all about computer science fundamentals, architecture, pipelining, busing, data integrity, etc. It’s a visual game, but it’ll scratch the itch of programming. It’ll get them to think.

    Buy the hardware projects, the little ones with either a pic, an Arduino, something that does something physical. A little bit of programming. To make a thing happen. So they can experiment.

    Look at the software robot competitions, there’s a couple on steam, there’s couple elsewhere, you can do it as a family project, whiteboard out the logic of what your robot will do, and you can write it together. And see how it acts.

    Just make sure anything you get, has a very small feedback loop, so they can iterate very quickly. That’ll keep them engaged and exploring. You don’t want to get a daunting project that’s going to take weeks to see any output. You want things on the order of minutes, or even seconds to see what happens

    • Szwajcer@discuss.tchncs.de
      link
      fedilink
      arrow-up
      18
      ·
      1 year ago

      Ah, haven’t thought about factorio. On that matter 7 Billion Humans is a cool game that can teach the basic logic behind programming.

    • jet@hackertalks.com
      link
      fedilink
      English
      arrow-up
      6
      arrow-down
      2
      ·
      edit-2
      1 year ago

      Get a breadboard. Get a bunch of wire for it. And do small projects with the breadboard in a controller. It’s fun to move the wires around. You can even build a tiny 8-bit computer with a breadboard. And have a do things like output of display. It’s very tactile and hands-on. Excellent visual. There’s excellent YouTube tutorials up there for breadboard projects.

      https://www.youtube.com/channel/UCS0N5baNlQWJCUrhCEo8WlA

      This guy has some excellent breadboard projects. Find an easy one. And do it together with your child

    • Big P@feddit.uk
      link
      fedilink
      English
      arrow-up
      3
      ·
      1 year ago

      If you get them factorio then they’ll just play that all day instead of learning programming

      • shagie@programming.dev
        link
        fedilink
        arrow-up
        2
        ·
        1 year ago

        I wrote this a while back… I still think it’s true (though I don’t think its “finished”)


        Factorio

        So there’s this game I play… just a little bit. Factorio.

        In playing this game, I’ve realized that there are several parts of the game play that are directly applicable to software design. The idea of Patterns becomes more clear on how to explain them and how to use them in regular software when one can point to something a bit more concrete (all be it a construct in a virtual world). A visual example of reasonable design and problems of scale are also software design issues that become more apparent with factorio.

        Patterns

        Patterns are a favorite rant of mine - that developers are asking for a pattern to do something and you take a Something and a SomethingElse and link them together and you’ve got a working application.

        Factorio gives me a better way to explain what a Pattern is.

        One of the problems that I’ve had in factorio is a pump that flickers on and off rather quickly. This made a mess of the power display (a very high frequency sine wave was evident - determining the actual overall power consumption over time became more challenging) and lights that were hooked up to it to indicate that the pump was on were flickering at a high frequency (a rather annoying strobe).

        The cause was that the pump (and light) were connected to a tank containing refined oil. The pump was to pump off excess when it got to 24,000 units. If the tank was at 24,100 units the pump would pump off 200 units putting it at 23,900 and shutting off. One sixtieth of a second later, something would push another 200 units of refined oil into the tank and the pump would trigger on and off for a sixtieth of a second - the flickering and the high frequency showing up in the power.

        The solution to this is to use what is known as a Schmitt trigger. This is a circuit that feeds back to itself with a positive feedback loop. When the trigger turns on at a given threshold it will remain on until the value drops below a different threshold. The way that the trigger was set up was so that when the material reached 24,000 units, it would turn the pump on until the level was at 22,000 units.

        The way this was implemented was to use a decider combinator which takes a signal as input (the amount of material in the tank) and sends a signal as output (the value 1 in a given channel) based on some logic (the amount of material in the tank is greater than 24,000). Then a second combinator - an arithmetic combinator - would take that signal of 1 and then multiply it by 2,000 and send that result into the input of the decider combinator. The result would be that the signal is now 26,000 and it would run until the material drops to 24,000 in which case the signal from the decider would switch from 1 to 0 and the arithmetic combinator would stop sending the additional 2000 units as a signal… and we would see the real value of the tank at 22,000.

        The Schmitt trigger is a Pattern.

        It is silly to be suggesting that one would design something based on the answers to “what are useful Patterns when creating an oil processing area?” One doesn’t add something unless its necessary to solve a problem. And one doesn’t go looking for places to use a Schmitt trigger or other Pattern - they are tools for solving specific problems.

        Reasonable design

        The first base that a person builds is often what is known as a spaghetti base. The layout is ad-hoc. As you need something from somewhere (some iron plates) to get to somewhere else you split off from a convenient, nearby belt with some iron on it and run it over to the place it is needed. It sounds ok at first, but doing this a few dozen times the layout becomes more and more convoluted.

        Enter the main bus.

        The main bus is a design where there is a large number of belts running down the center of the base and things tap off of it perpendicular for specific factories that build a given item.

        The taps off are well researched designs that have a specific fraction of the items shunted off to the factory. Instead of trying to figure out where the iron came from and how to get more iron down to that place maybe a few hundred tiles away, one can look at the main bus and see a dozen tiles and understand what that sub factory is making and how many resources it needs.

        The reasonable design allows one to more quickly fix issues of resource starvation and allocation along with refactoring of specific areas of the overall system without worry about impact to things downstream. The base is reasonable.

        Problems of scale

        After playing a bit and winning the game a time or two, one gets the urge to build BIG. Not these little “launch a rocket every couple of minutes” but rather “launch a rocket every second.”

        The design for the one rocket every few minutes is fundamentally different than the design for one rocket every second. The layout of the base for a simple mainline works well - but it doesn’t have the throughput for materials that would enable the launch a rocket every second goal.

        For this, one starts building outpost factories that do one thing, and one thing well. This outpost takes iron ore and produces iron plates. That outpost takes iron plates and copper plates and produces green circuits. So on and so forth.

        This is a very different design - switching from a main bus to train logistics (trains become the way to move massive amounts of material). The very structure of the base for a megabase vs a regular base shows differences at every level.

        Many times one reads about developers having difficulties with microservices and trying to build something to scale to 1000 users per second. And then comes the moment when they are asked how many users per second they’re currently getting and the answer is something along the lines of “Um, we’re getting maybe 5 a second on a good day… but we’re getting ready for being Amazon or Twitter scale.”

        Design for what works. It is often easier to redesign a working system up than it is to try to start out with the megabase or amazon scale system and fight all those little problems of outpost base train networks and microservices that you haven’t encountered before in a working system.

  • IAm_A_Complete_Idiot@sh.itjust.works
    link
    fedilink
    arrow-up
    26
    ·
    edit-2
    1 year ago

    See if you can find a book on python, and work through it a bit. Sit down with him once you know some and try making something basic with turtle or the likes. Your goal is to keep his interest up and not make it a “studying” thing. For a kid the most important part is that he needs to be able to see results of what he’s making. Drawing simple shapes, cool patterns, etc. in python is a nice way to start and it can teach all the basic initial things he needs to know.

    There’s also simple robot kits for kids that could be fun to play with, which he could eventually move on to basic electronics to after from.

    W.r.t. safe browsing, I’d try blocking egregiously bad stuff with some DNS blocker that you either buy or host using something like pihole. Use it to block ads and well known “bad” domain names. Also have a conversation about it. (I’m not sure how much this helps here considering he’s 8… but better then nothing.)

  • Szwajcer@discuss.tchncs.de
    link
    fedilink
    arrow-up
    18
    ·
    edit-2
    1 year ago

    Well, Scratch is certainly a good starting point so I would assume he wants more if he’s been all over it.

    There are some toys and kits available but I am not really aware if they are any good.

    If my little brother would make such a request I probably would want to go with Python and an Arduino project. Robots are cool so it would pique his curiosity while basics with Arduino should be challenging but manageable. The only drawback is that it probably would require some time investment on your side.

    A cheaper alternative would be directing him towards writing some simple programs in Python or Java as the only setup this would require is an IDE and it would also teach him googling for information.

    I think the safety online is the biggest problem here and the only thing I can think of is to only allow some domains…

    Maybe some of these suggestions sound good to you, if so I’ll gladly expand on them.

    Also big kudos to your approach on the matter.

  • shagie@programming.dev
    link
    fedilink
    arrow-up
    18
    ·
    1 year ago

    He has an iPad 6

    I believe you’d be able to load up Swift Playgrounds on that now as a “here’s a place to start” - https://www.apple.com/swift/playgrounds/ - it is a very safe place to start.

    In general, I’m gonna ask “why?” for loading up a Linux distribution on a Mac unless there is specific software that you’re after that only runs on Linux. For the most part, launch a terminal and you’re getting 90% of what the Linux experience has to offer (Mac OSX is a unix certified operating system).

    I’d look also for games that are programming under the covers or related. Factorio (circuits) and Minecraft (red stone logic) are two that come to mind first.

    Shenzen I/O (and the rest of Zachtronics) along with Human Resource Machine and 7 Billion Humans might be a bit more, but also something he could “grow into”.

    I would suggest staying as far away from Roblox as possible.

  • Wet@lemmy.world
    link
    fedilink
    arrow-up
    16
    ·
    1 year ago

    In terms of keeping him safe online look into some content filtering for the whole home network, either paid or self-hosted.

    Projects that act upon physical stuff are the most rewarding. Something simple such as building a simple Python script that interacts with a smart home API and turns switches on/off or changes light colors around the house are relatively simple and require no hardware/mechanics if you’re not into robotics, soldering or circuit boards.

    You’ve got a great kid :)

      • Big P@feddit.uk
        link
        fedilink
        English
        arrow-up
        3
        ·
        1 year ago

        Writing a program in assembly for 6502 processor might be a little bit too far from scratch for an 8 year old

        • MonkCanatella@sh.itjust.works
          link
          fedilink
          arrow-up
          2
          ·
          1 year ago

          HAHA yes of course of course. But it’s not out of the realm of possibility if they show an interest in it. Ben does some really simple projects that an 8 yr old could tackle to get some real fundamental understanding of what’s going on under the hood.

  • MajorHavoc@lemmy.world
    link
    fedilink
    arrow-up
    12
    ·
    1 year ago

    Make Code Arcade is a great next step if your child has completed the Scratch tutorials.

    MakeCode allows building with BlockCode, but also supports toggling to Python or JavaScript.

    Scratch and Make Code Arcade are both free.

    For the Christmas present, get them a [MeowBithttps://www.microcenter.com/product/668481/kittenbot-meowbit-card-sized-retro-game-computer-codable-console) - a $50.00 hand held game system that plays the games they write using MakeCode Arcade.

    • Lem453@lemmy.ca
      link
      fedilink
      arrow-up
      5
      ·
      edit-2
      1 year ago

      The full Harvard CS50 course is available on YouTube: https://youtu.be/8mAITcNt710?si=rTa1zOkY2REnlXDe

      This is the course all programmers have to take before they get to take the real programming course. The purpose is to introduce programming concepts in a way that essentially anyone who is interested will be able to understand. The instructor is fantastic.

      Not exactly geared towards 8yo but if you have the time and inclination, you could go through some of these videos to see how the topics are presented and then try to introduce those topics yourself to your child. Or at least look for resources that introduce them like the comment above talking about scratch.

      Or better yet, maybe you both do these lectures together and learn the fundamentals of programming without getting bogged down in a specific language or with specific syntax. I’d bet that will become a core memory for any child.

  • fmstrat@lemmy.nowsci.com
    link
    fedilink
    English
    arrow-up
    11
    ·
    1 year ago

    One suggestion I haven’t seen, get him a super-cheap laptop with Linux. The exposure to a new environment beyond his phone (and likely Chromebook) will help him get more comfortable with things outside the norm.

    It will help him discover if he likes to “make things” or “figure things out” which are very different activities that both directly corrolate with programming.

    • Alxrg@lemmy.ca
      link
      fedilink
      arrow-up
      6
      ·
      1 year ago

      +1 for Linux but use your MacBook Air. There are Educational Linux versions that would be a great environment for your kid to learn to code. It can also be set up with kid safeguards.

      You can also run Linux from a Usb if you’d rather not install it over MacOS

      I recently put Linux (Mint) on my old 2015 MacBook Air and it’s been really great.

      • svetlyak40wt@fosstodon.org
        link
        fedilink
        arrow-up
        1
        ·
        1 year ago

        @Alxrg @fmstrat oh, I’ve installed Ubuntu on Macbook but had many troubles with the keyboard.

        Probably some of these problems are originated from the StumpWM – a tiling window manager written in #commonlisp

        Not all problems are solved yet. For example, a key near the left shift should produce ` and ~, but it outputs < and > instead. I don’t know how to remap it.

        • Alxrg@lemmy.ca
          link
          fedilink
          arrow-up
          2
          ·
          1 year ago

          For OP’s question (just to stay on topic before we veer off), would you still recommend a Linux distribution on their MacBook Air?

          Edubuntu seemed like a good choice to reuse their existing hardware and have a safe environment. There’s lots more choices to choose from

          I’m only casually using my Linux MacBook but haven’t had any troubles with the keyboard.

          Although a nice tiling window manager sounds like fun. I’ll have to look into it.

  • adr1an@programming.dev
    link
    fedilink
    arrow-up
    11
    ·
    1 year ago

    I don’t want to undermine everyone’s suggestions but I think they are failing to understand this is a kid, buying him a laptop and stuff is okay but doesn’t motivate him to much.

    Check for authors of books for kids. Invent with python is great, that was going to be my suggestion. But same author has plenty, like this one https://turtleappstore.com/book/ … to echo someone who mentioned Minecraft (indeed, already marked a whole generation into computer science subject!). Good luck! Maybe you can even find something for you, like, how do we teach CS/ programming to kids? How come that moving the Logo turtle was alright for so many years, lol

  • 56!@lemmy.ml
    link
    fedilink
    arrow-up
    10
    ·
    1 year ago

    I learned programming at about 12, by following tutorials for the Pygame python library. It doesn’t do anything especially fancy, but it taught me many concepts, while I had a lot of fun. My first project was making the traditional snake game, which I think is a good level of complexity.

  • Sinnerman@kbin.social
    link
    fedilink
    arrow-up
    10
    arrow-down
    1
    ·
    1 year ago

    This was a while back, but my cousin learned to program using Codecademy. These were self-paced courses using web interfaces, which was nice because they didn’t have to install anything, they just used a web browser.

    It looks like codecademy has a game development path: https://www.codecademy.com/catalog/subject/game-development

    Their python chatbot course looks fun too: https://www.codecademy.com/learn/paths/build-chatbots-with-python

  • psycho_driver@lemmy.world
    link
    fedilink
    arrow-up
    8
    ·
    1 year ago

    Do you have a linux machine at home? My 12 year old daughter is also wanting to learn to program and I’ve been updating the NakedMUD codebase to work with Python 3. It has been working for a while now but I’m still tweaking some stuff within the codebase before turning her loose on it. When it’s ready I’ll probably throw the modified code up on a server somewhere.

    If you’re not familiar with MUDs they’re online text-based game servers (Everquest was basically a graphical version of one, supposedly even using code stolen from the most popular at the time). NakedMUD has a core written in C but the game engine itself is extensible with Python (and Python changes can be initialized without rebooting the server) and the world/NPC handling code is also extensible with Python. Users can dabble around with making changes to the Python scripts and then see the results real time, and in a gaming environment. To me it seemed like the ideal way for my daughter to learn programming in a way that will likely keep her interest.

    • Nate Cox@programming.dev
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 year ago

      MUDding taught me programming and Regex in a very real and useful way.

      It also contributed to a gaming addiction that took years to break, so food for thought I guess.