Author Topic: Learning Simple Programming for a Ten Year Old?  (Read 6202 times)

0 Members and 1 Guest are viewing this topic.

Offline Smokey

  • Super Contributor
  • ***
  • Posts: 3044
  • Country: us
  • Not An Expert
Re: Learning Simple Programming for a Ten Year Old?
« Reply #25 on: November 13, 2022, 03:05:16 am »
Didn't Lego made some sort of programmable stuff?
...

They are discontinuing the Mindstorms stuff, but I guess they have a new option:
https://www.theverge.com/2019/4/2/18292326/lego-spike-prime-programming-bricks-scratch-technic-robotics

...
Would be great for him to program something he can actually see and play with.

Isn't that essentially why we all got into embedded systems and not pure computer science?
 

Online Picuino

  • Super Contributor
  • ***
  • Posts: 1072
  • Country: es
    • Picuino web
Re: Learning Simple Programming for a Ten Year Old?
« Reply #26 on: November 13, 2022, 02:05:26 pm »
For a 10 year old who is just starting out:

Code.org: https://code.org/
Guided challenges to start programming in a gamified way


Scratch: https://scratch.mit.edu/projects/editor/
MIT's big bet to teach programming to children. The language is ranked 21th in popularity of all languages according to the TIOBE index.


Makey Makey: https://makeymakey.com/
Very simple board to start with physical computing in a fun way.

micro:bit: https://makecode.microbit.org
Another physical board.

Both boards, Makey Makey and micro:bit, can be programmed from Scratch.

Edit:
https://appinventor.mit.edu/
Another development environment to create applications for mobile devices.
« Last Edit: November 13, 2022, 02:08:29 pm by Picuino »
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 13157
  • Country: ch
Re: Learning Simple Programming for a Ten Year Old?
« Reply #27 on: November 13, 2022, 04:37:31 pm »
I’ve had a terrible day. I’m sorry. Take care.
That’s an explanation, but no excuse. I say this truly with no malice: you really need to take a step back and figure out a way to stop yourself from posting when you’re in a mood. You’re too reactive and impulsive in that state.
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 13157
  • Country: ch
Re: Learning Simple Programming for a Ten Year Old?
« Reply #28 on: November 13, 2022, 04:41:09 pm »
My grandson is turning ten next month, and I would like to expose him to simple programming.  I'm not trying to turn him into a "coder", but I remember my early experiences with computers and enjoying simple programming essentials such as counting, calculating squares and primes, even just "Hello World".  I am looking for recommendations, probably not graphically-oriented, but simple BASIC or whatever the current thing would be.  I want him to see the numbers and the logic.
Honestly, why not an Arduino kit? I think being able to control hardware (like lights, displays, motors, etc) makes programming fun (more so than doing math), and it’s really not hard. There are lots of kid-oriented Arduino tutorials, both text and video.
 

Online Picuino

  • Super Contributor
  • ***
  • Posts: 1072
  • Country: es
    • Picuino web
Re: Learning Simple Programming for a Ten Year Old?
« Reply #29 on: November 13, 2022, 06:24:27 pm »
Honestly, why not an Arduino kit? I think being able to control hardware (like lights, displays, motors, etc) makes programming fun (more so than doing math), and it’s really not hard. There are lots of kid-oriented Arduino tutorials, both text and video.

Because programming an Arduino is too complex for a normal 10-year-old.

For these ages there are already adapted, simpler "development boards", such as Makey Makey.
 

Offline NiHaoMike

  • Super Contributor
  • ***
  • Posts: 9321
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: Learning Simple Programming for a Ten Year Old?
« Reply #30 on: November 13, 2022, 07:44:34 pm »
Because programming an Arduino is too complex for a normal 10-year-old.
If Arduino existed back then, I'm pretty sure I could figure it out at that age.
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 

Online Picuino

  • Super Contributor
  • ***
  • Posts: 1072
  • Country: es
    • Picuino web
Re: Learning Simple Programming for a Ten Year Old?
« Reply #31 on: November 13, 2022, 07:59:07 pm »
Sure. 1% can do so.

Because programming an Arduino is too complex for a normal 10-year-old.
 

Online fourfathomTopic starter

  • Super Contributor
  • ***
  • Posts: 2005
  • Country: us
Re: Learning Simple Programming for a Ten Year Old?
« Reply #32 on: November 13, 2022, 08:53:31 pm »
Sure. 1% can do so.

Because programming an Arduino is too complex for a normal 10-year-old.

And I'm sure my grandson could figure it out *IF HE REALLY WANTED TO*  But, he doesn't, at least not yet.  He doesn't even want to build a robot, not yet.  That's why I'm looking for something with a very low barrier to entry, and perhaps he will be able to do something interesting enough at first that it will motivate him to push ahead.  Or at least show him that "programming" isn't beyond his reach.

I do like the idea of the LEGO and other hardware approaches, and will look into those suggestions.  I would prefer that the underlying "X = X + 1" stuff not be hidden underneath too many layers of abstraction, but if it takes abstraction to make it interesting then I suppose that's a good way to get started.
We'll search out every place a sick, twisted, solitary misfit might run to! -- I'll start with Radio Shack.
 

Online Picuino

  • Super Contributor
  • ***
  • Posts: 1072
  • Country: es
    • Picuino web
Re: Learning Simple Programming for a Ten Year Old?
« Reply #33 on: November 13, 2022, 09:21:19 pm »
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 13157
  • Country: ch
Re: Learning Simple Programming for a Ten Year Old?
« Reply #34 on: November 14, 2022, 08:16:24 am »
Honestly, why not an Arduino kit? I think being able to control hardware (like lights, displays, motors, etc) makes programming fun (more so than doing math), and it’s really not hard. There are lots of kid-oriented Arduino tutorials, both text and video.

Because programming an Arduino is too complex for a normal 10-year-old.

For these ages there are already adapted, simpler "development boards", such as Makey Makey.
I really don’t think it is. Many, many, many people got into programming at younger than age 10, many into serious programming. Will every kid take to it? Of course not. But neither do many adults.
 

Offline sokoloff

  • Super Contributor
  • ***
  • Posts: 1799
  • Country: us
Re: Learning Simple Programming for a Ten Year Old?
« Reply #35 on: November 14, 2022, 10:32:14 am »
I don’t think c++ is an ideal first language for a 10 year-old. It’s too easy to make a mistake in syntax and get a fairly unhelpful error message from the compiler. (Plus the Arduino IDE isn’t very helpful in general.)

If you have an experienced programmer to guide you, it’s totally doable, but if you don’t, it’s easy to get frustrated.

Languages with a REPL or at least without a distinct compile-link stage (slight hand wave here) are often easier for beginners to pick up.
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 13157
  • Country: ch
Re: Learning Simple Programming for a Ten Year Old?
« Reply #36 on: November 14, 2022, 11:12:51 am »
I don’t think c++ is an ideal first language for a 10 year-old. It’s too easy to make a mistake in syntax and get a fairly unhelpful error message from the compiler. (Plus the Arduino IDE isn’t very helpful in general.)

If you have an experienced programmer to guide you, it’s totally doable, but if you don’t, it’s easy to get frustrated.
But isn’t that exactly the situation here?
 

Offline Fred27

  • Supporter
  • ****
  • Posts: 727
  • Country: gb
    • Fred's blog
Re: Learning Simple Programming for a Ten Year Old?
« Reply #37 on: November 14, 2022, 11:29:33 am »
I'd definitely recommend something visual like Scratch. I think the key is to find what sort of coding interests your kid in particular.

For instance, my boys loved creating video games with Make Code Arcade. I pormised to create a Pi-based physical arcade for them if they wrote an original game. I know that a friend's daughters were more interested in making a little cartoon in Scratch. (My boys weren't.) As someone else mentioned, Lego Boost / Wedo 2.0 / Spike Prime may be their thing. There's also a raspberry Pi hat to interface with it too. Unfortunately Lego can't seem to keep to one product range and they're all subtly different.
 

Offline sokoloff

  • Super Contributor
  • ***
  • Posts: 1799
  • Country: us
Re: Learning Simple Programming for a Ten Year Old?
« Reply #38 on: November 14, 2022, 01:15:46 pm »
If you have an experienced programmer to guide you, it’s totally doable, but if you don’t, it’s easy to get frustrated.
But isn’t that exactly the situation here?
If OP lives with their grandson full-time, yes. I didn’t find that in evidence, so suggested a course that would allow the child to
make progress as their interests drive them rather than only as grandpa visits.
 

Online fourfathomTopic starter

  • Super Contributor
  • ***
  • Posts: 2005
  • Country: us
Re: Learning Simple Programming for a Ten Year Old?
« Reply #39 on: November 14, 2022, 05:03:33 pm »
If you have an experienced programmer to guide you, it’s totally doable, but if you don’t, it’s easy to get frustrated.
But isn’t that exactly the situation here?
If OP lives with their grandson full-time, yes. I didn’t find that in evidence, so suggested a course that would allow the child to
make progress as their interests drive them rather than only as grandpa visits.

Yes, that's pretty much correct.  I spend a lot of time with my grandson (we're best buddies), but there are big gaps.  I would like to find something that grabs his interest, but I will be satisfied if he just learns enough to not be intimidated by it all as he grows up.

Again, I appreciate all the discussion here.
We'll search out every place a sick, twisted, solitary misfit might run to! -- I'll start with Radio Shack.
 

Offline rdl

  • Super Contributor
  • ***
  • Posts: 3667
  • Country: us
Re: Learning Simple Programming for a Ten Year Old?
« Reply #40 on: November 14, 2022, 06:53:40 pm »
You might consider Parallax. They're not cheap and wouldn't be of interest to most people here. But, their primary focus is education and the quality of what they produce is excellent. Your grandson is right at the lower end of their age recommendations.

https://learn.parallax.com/tutorials/grade/grades-5-8
 

Online Nominal Animal

  • Super Contributor
  • ***
  • Posts: 7194
  • Country: fi
    • My home page and email address
Re: Learning Simple Programming for a Ten Year Old?
« Reply #41 on: November 25, 2022, 04:35:16 pm »
Pileofstuff reviewed the CrowBot Bolt - Open Source Programmable Smart Robot Car kit:

and it seems to be very nice, open source programmable, and not too pricy ($60 or so with the joystick, both joystick and robot having ESP32's and are user-programmable).

I am only slightly ashamed to admit this looks like something I might enjoy, and am considering getting just for myself.
 

Offline artag

  • Super Contributor
  • ***
  • Posts: 1284
  • Country: gb
Re: Learning Simple Programming for a Ten Year Old?
« Reply #42 on: November 25, 2022, 05:32:33 pm »

And I'm sure my grandson could figure it out *IF HE REALLY WANTED TO*  But, he doesn't, at least not yet.  He doesn't even want to build a robot, not yet.  That's why I'm looking for something with a very low barrier to entry, and perhaps he will be able to do something interesting enough at first that it will motivate him to push ahead.  Or at least show him that "programming" isn't beyond his reach.


I think that's key. Some people love programming for it's own sake, but I think most of us got into it because it was a tool to do what we wanted to do. He'll learn to do anything if he sees it as a way to realise his imagination.

So, start with what he loves.  If that's only playing games it's much the same as watching television. But if he's dissatisfied with what he has and wants more - different gameplay, or characters, or better interaction - then programming or electronics is a path he might try.
   
 

Online Nominal Animal

  • Super Contributor
  • ***
  • Posts: 7194
  • Country: fi
    • My home page and email address
Re: Learning Simple Programming for a Ten Year Old?
« Reply #43 on: November 25, 2022, 06:22:03 pm »

And I'm sure my grandson could figure it out *IF HE REALLY WANTED TO*  But, he doesn't, at least not yet.  He doesn't even want to build a robot, not yet.  That's why I'm looking for something with a very low barrier to entry, and perhaps he will be able to do something interesting enough at first that it will motivate him to push ahead.  Or at least show him that "programming" isn't beyond his reach.


I think that's key. Some people love programming for it's own sake, but I think most of us got into it because it was a tool to do what we wanted to do. He'll learn to do anything if he sees it as a way to realise his imagination.

So, start with what he loves.  If that's only playing games it's much the same as watching television. But if he's dissatisfied with what he has and wants more - different gameplay, or characters, or better interaction - then programming or electronics is a path he might try.
 
I agree, that's why I thought the above kit might suit fourfathom's grandson: it is easy enough to put together (no soldering or anything, see the video), and you can use the wireless "joystick" (more like a gamepad) to drive the robot around too, with ready-made programs for other stuff.  No need to learn to program, if one does not want to.

What I like about this kit, is that it is open source.  Not only the software, but also the schematics and Eagle files are available.  This is the way STEM toys should be done.

 

Offline gamalot

  • Super Contributor
  • ***
  • Posts: 1397
  • Country: au
  • Correct my English
    • Youtube
Re: Learning Simple Programming for a Ten Year Old?
« Reply #44 on: November 25, 2022, 06:44:14 pm »
Children are smarter than people think! Half a year ago, I taught my son how to use Python to control character movement and build simple patterns in Minecraft Education Edition, and he understood it easily. A few days ago, I taught him how to solve linear equations in three variables. After I explained it to him once, he could do it by himself. In 40 days, he will be 10 years old, and I will start teaching him programming, starting with Python.
I'm a poet, I didn't even know it. |  https://youtube.com/@gamalot | https://github.com/gamalot
 
The following users thanked this post: tooki, RJSV

Online Zero999

  • Super Contributor
  • ***
  • Posts: 20361
  • Country: gb
  • 0999
Re: Learning Simple Programming for a Ten Year Old?
« Reply #45 on: November 25, 2022, 07:11:44 pm »
I started programming with QBasic, which of course many remember was shipped with MS-DOS.

I've played with FreeBASIC which works quite well.

Another option is QB64, which I've not tried, but is supposed to be very close to the original QBasic.
https://qb64.com/
 

Offline Cyberdragon

  • Super Contributor
  • ***
  • Posts: 2676
  • Country: us
Re: Learning Simple Programming for a Ten Year Old?
« Reply #46 on: November 25, 2022, 07:44:04 pm »
Didn't Lego made some sort of programmable stuff?
...

They are discontinuing the Mindstorms stuff, but I guess they have a new option:
https://www.theverge.com/2019/4/2/18292326/lego-spike-prime-programming-bricks-scratch-technic-robotics

They canned it since the new one was kinda meh and it's all online based. The software for older systems can still be found though, everything from RCX to EV3. If you want to get the new systems running on their own without Lego, use https://pybricks.com/
*BZZZZZZAAAAAP*
Voltamort strikes again!
Explodingus - someone who frequently causes accidental explosions
 

Online RJSV

  • Super Contributor
  • ***
  • Posts: 2760
  • Country: us
Re: Learning Simple Programming for a Ten Year Old?
« Reply #47 on: November 25, 2022, 09:44:58 pm »
   Try an approach, like an airplane flying lesson.
Kid sits a little back, while you go through a whole pile of install, activate, etc. But not for too long.
Then, you switch seats, have him enter something simple, like printf "My name is 'xxxx", maybe 3 times.
Then, a simple 'If Then',  and build up from there.
   That way you aren't teaching, immediately, the whole operating system, file system etc.  Basically you would be letting more and more control (programming) be learned.  Explain to kid, the operating system is a kind of environment, like a little village, explain he has to gradually learn, not just programming itself, but all the capability (he) needs to navigate the system.
   And explicitly explain, the system is a lot to learn also, gradually, warning not to feel overwhelmed, by complexity, but that he has to develop focus, in things like program creation.
   You guys can always switch seats, when you need to take the reins, when some compiler error gets in.
 

Online Nominal Animal

  • Super Contributor
  • ***
  • Posts: 7194
  • Country: fi
    • My home page and email address
Re: Learning Simple Programming for a Ten Year Old?
« Reply #48 on: November 25, 2022, 11:31:01 pm »
For Python, I warmly recommend starting early with PySDL2 and/or Qt5 (PyQt5 or PySide2), and using Inkscape to create all graphics in the SVG (Scalable Vector Graphics) format, saving originals in Inkscape SVG format, and "finals" using Optimized SVG.  The former retains your Inkscape guides and such, but the latter optimizes the SVG for parsers, also shrinking the file size.  SVG images are fully scalable, support transparency, and even gradient fills.  You can also use any browser to view SVG files.

The reason for this is that you can do real games and applications this way, and have them look as professional as you can.  There are no limitations.  Even if you decide you go to high-performance graphics via OpenGL, that works too; there are display widgets for that as well.

The one annoying thing with Inkscape is that when you do computer graphics with it, you need to do a three-step Document Setup in the beginning.
First, in File > Document Properties, you need to set Display Units: px and Units: px, Scale: 1, Checkerboard Background, and Width: and Height: to the desired size in pixels.  This way, all px measurement units in the SVG file are in native SVG units, and you get the best results overall (no DPI issues et cetera; these work just fine even on HiDPI displays).  See attached inkscape-1-pixel-mode.png.

Because Inkscape chose the right-hand coordinate system with origin at bottom left corner, changing document properties will always introduce an annoying translation to the SVG coordinates, even when the canvas is empty.  To fix that, in Edit > XML Editor, select the id="layer1" element on the left, and then the transform on the right.  Delete it using the Delete Attribute button top right, and close that window.  See attached inkscape-2-fix-transform.png.

Modifying any of the layers in XML Editor causes Inkscape to drop to canvas root "layer".  You don't want to draw there, you want to switch to Layer 1, because Inkscape uses the SVG g layers to do its internal markup and such.  The selection is at the bottom left/center of the window; just click where it reads (root) and pick Layer 1.  See attached inkscape-3-select-layer.png.

In Python, you can load SVG files as QPixmap objects, which are optimized for display on-screen.  You can use a QPixmap in QLabels instead of text, in QGraphicsScenes, even in QPictures if you want to create a drawing application of some sort.

Of course, there are Python modules and libraries that make it even easier to create games, but this is the "real world" complexity level when creating user interfaces and applications in Python.  As PySDL2 documentation shows, it is much more oriented towards game development, and has its own internal approach and model as to how game mechanics (sprites, et cetera) should be constructed.
However, both firmly use event-based programming model, the main difference being that with SDL2 the programmer is in control of the event loop, whereas in Qt5 (and basically in all windowing toolkits like Gtk, FLTK, etc.) the toolkit is in charge, and you just write the code responding to the events.

To additionally interface to microcontrollers, I recommend using a separate Python thread (or two); or a separate process, if there is a significant amount of data (more than full-speed USB, 12 Mbit/s) or processing (like FFTs or such) involved.
« Last Edit: November 25, 2022, 11:33:48 pm by Nominal Animal »
 
The following users thanked this post: RJSV

Online Nominal Animal

  • Super Contributor
  • ***
  • Posts: 7194
  • Country: fi
    • My home page and email address
Re: Learning Simple Programming for a Ten Year Old?
« Reply #49 on: November 26, 2022, 12:07:24 am »
An aside, since it WILL come up with anyone teaching kids to manipulate sprite-like images:

Qt and other widget toolkits cannot detect when partially transparent SVG or PNG images overlap.  The solution for that is to subclass QPixmap (or whatever widget you use to represent stuff on-screen, often QLabels or QGraphicsItem), and add hitbox support.  One can then check if they overlap or intersect, by checking if their hitboxes intersect.  In most cases, hitboxes are either axis-aligned rectangles, or circles, defined in the SVG or PNG (pixel) coordinates (important!).  It is simplest to use either rectangles OR circles, because rectangle-rectangle and circle-circle intersections are trivial, but rectangle-circle intersection is a bit tricky, especially if the rectangle is large compared to the circle.  However, Qt also provides QPolygon or QPolygonF classes with .intersects() method, that will tell you if two polygons intersect.  If you define their coordinates in the SVG or PNG pixel units, that gives very detailed hitboxes.  On the other hand, (collections of) circular hitboxes can also do directional reflections, which is neat if you have e.g. a bulletproof character and want the bullets to just ping off.

One good approach to create sprite-like animated objects in Python is to use Python's built-in configparser to describe the images (animation) and hitboxes in a plain text INI-type file.  Create a library class, initialized by specifying the path to an ini file, and have it load the images and information, and create a library of the aforementioned subclassed widgets.  The library itself only needs a simple list() and get(name) interface.  Depending on the game, you can add structure to the library, for example each character direction having their own animations, et cetera.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf