This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
oeed's profile picture

How to teach kids (13 +) to code?

Started by oeed, 11 January 2014 - 04:03 PM
oeed #1
Posted 11 January 2014 - 05:03 PM
Hi,

So, late last year I join this thing at school and some how or another I ended up attempting to teach a few year 8 kids (13-14) in this group thing how to do basic coding. I started with Xcode but threw that out the door about 5 minutes in. I then decided that JavaScript might be a good idea. It sort of worked, but because they didn't really know much about HTML it made it more difficult and I could see that they weren't really getting it. Skip forward to about a week ago and the teacher which was coordinating it emailed me to ask if I'd be interested in running it for all year levels (so from 13yo to 18yo). As I think it would be a good thing to do and I'd like to improve my public speaking I said yes. However, I've spent the last week trying to figure out how to teach quite possibly 30+ people how to code.

JavaScript isn't really ideal, I don't really want to do a visual (block based) language. I should also state that it only needs to support Mac, Linux or Windows support is irrelevant. Now, I know many of you are screaming, "Just use ComputerCraft!" However, I'm not really sure if it's the best place to start, and besides, I don't know how keen the teachers will be with everyone using Minecraft during school.

So, after a rather long winded back story, what is the easiest programming language/environment to teach to kids?
Bubba #2
Posted 11 January 2014 - 05:28 PM
Khan academy has a pretty good Javascript web interpreter that allows for everything from simple "hello world" programs to complex three dimensional graphical objects . Because it is web-based, you don't have to worry about platform issues (you say you care only about mac, but keep in mind that some may want to go home and try on their Windows computers). JavaScript is, in my opinion, a very good language to beginning working with (although Object orientation with prototypes is a bit strange).

If you are intent on not using the net, then why not start with Lua? Lua is an extremely simple, object oriented language that can do everything you might want to teach beginners, and it is easy enough to install/run on any platform.
Edited on 11 January 2014 - 04:33 PM
Symmetryc #3
Posted 11 January 2014 - 05:37 PM
LISP, Lua, or Python :)/>.
6677 #4
Posted 11 January 2014 - 05:41 PM
Python or lua. I actually have a disliking towards lua but have no choice when it comes to minecraft computers.

Personally I find python to be the far superior option while not being harder. As for mac/windows/linux compatibility it has that nailed. Mac and Linux systems all have python 2 preinstalled (the best version :P/> actually 3 is newest but there are more resources for 2 so that may be an advantage). Most modern linux systems have Python 3 aswell. Windows its dead easy to install either option. 2 and 3 are not 100% compatible.

Ruby could also be added to the list I guess.
awsmazinggenius #5
Posted 11 January 2014 - 05:41 PM
There is MinecraftEdu, but not everyone will want to buy that. Lua and Python (my two most favourite languages, at this point) both have simple, elegant syntax. There is this little gem (http://repl.it/languages) that you can use for lua and I think python.
EDIT: two damn ninjas. IP.Board even said that 2 people ninja'd me
EDIT 2: Have you heard of the code.org project? It's trying to get kids to code. You might find some resources there.
Edited on 11 January 2014 - 04:46 PM
oeed #6
Posted 11 January 2014 - 06:15 PM
Khan academy has a pretty good Javascript web interpreter that allows for everything from simple "hello world" programs to complex three dimensional graphical objects . Because it is web-based, you don't have to worry about platform issues (you say you care only about mac, but keep in mind that some may want to go home and try on their Windows computers). JavaScript is, in my opinion, a very good language to beginning working with (although Object orientation with prototypes is a bit strange).

If you are intent on not using the net, then why not start with Lua? Lua is an extremely simple, object oriented language that can do everything you might want to teach beginners, and it is easy enough to install/run on any platform.
Yea, actually I hadn't thought about using plain Lua. The reason I say Mac only is because everyone is required to have a MacBook, but I see where you're coming from. I've used Kahn Academy before for physics stuff but wasn't aware it had JavaScript, I'll take a look.

There is MinecraftEdu, but not everyone will want to buy that. Lua and Python (my two most favourite languages, at this point) both have simple, elegant syntax. There is this little gem (http://repl.it/languages) that you can use for lua and I think python.
EDIT: two damn ninjas. IP.Board even said that 2 people ninja'd me
EDIT 2: Have you heard of the code.org project? It's trying to get kids to code. You might find some resources there.
Repl.it may come in useful actually, I hadn't thought about that.

I'll check out code.org too.
CoLDarkness #7
Posted 12 January 2014 - 06:05 AM
Hi,

So, late last year I join this thing at school and some how or another I ended up attempting to teach a few year 8 kids (13-14) in this group thing how to do basic coding. I started with Xcode but threw that out the door about 5 minutes in. I then decided that JavaScript might be a good idea. It sort of worked, but because they didn't really know much about HTML it made it more difficult and I could see that they weren't really getting it. Skip forward to about a week ago and the teacher which was coordinating it emailed me to ask if I'd be interested in running it for all year levels (so from 13yo to 18yo). As I think it would be a good thing to do and I'd like to improve my public speaking I said yes. However, I've spent the last week trying to figure out how to teach quite possibly 30+ people how to code.

JavaScript isn't really ideal, I don't really want to do a visual (block based) language. I should also state that it only needs to support Mac, Linux or Windows support is irrelevant. Now, I know many of you are screaming, "Just use ComputerCraft!" However, I'm not really sure if it's the best place to start, and besides, I don't know how keen the teachers will be with everyone using Minecraft during school.

So, after a rather long winded back story, what is the easiest programming language/environment to teach to kids?


Well, I'm a kid too from that perspective.

But I could say Python looked the easiest for me.

Before teaching them programming languages, maybe you should start with the main aspects required for coding like algorithms and such.
oeed #8
Posted 12 January 2014 - 06:13 AM
Well, I'm a kid too from that perspective.

But I could say Python looked the easiest for me.

Before teaching them programming languages, maybe you should start with the main aspects required for coding like algorithms and such.

Well, I'm still a 'kid' per say, I'm a student at the school.

The thing I don't really like about Python is the pedantic indentation. I can just seem myself having to spend 90% of the time fixing peoples' indentation.

Well, the thing is, most people find algorithms, etc rather boring. They want to be able to see results as fast as possible. They expect to be able to spend an hour or two and make Angry Birds. For this reason, at the moment I'm leaning toward just using CC with Mimic (hopefully GravityScore updates it soon :D/>). The drawing is very easy compared to 99% of other mediums and it's a good starting point. But, I'm welcome for further suggestions. Battery life is a fairly large issues, however.
Edited on 12 January 2014 - 05:13 AM
Engineer #9
Posted 12 January 2014 - 06:31 AM
Well, the thing is, most people find algorithms, etc rather boring. They want to be able to see results as fast as possible. They expect to be able to spend an hour or two and make Angry Birds.
If they think this, you should first go over programming standards. You should do some basic boolean logic, standard statements in a pseudo-code kind of way. After that, you should start tutor programming in a specific language. Also, how silly it sounds, you should let them write pseudo-code as an assignment of sorts.

I really would recommend to use this programming diagram concept: http://en.wikipedia.org/wiki/Nassi%E2%80%93Shneiderman_diagram#See_also
For a tool here is one: http://eii.ucv.cl/nessi/

You really should tutor the real programming concepts first, otherwise you are going to get questions: "Why does x and y and z happen?"
If you are going to tutor then in a programming language, you only have to tutor them for instance the type of variables etc.
CoLDarkness #10
Posted 12 January 2014 - 06:32 AM
Well, I'm a kid too from that perspective.

But I could say Python looked the easiest for me.

Before teaching them programming languages, maybe you should start with the main aspects required for coding like algorithms and such.

Well, I'm still a 'kid' per say, I'm a student at the school.

The thing I don't really like about Python is the pedantic indentation. I can just seem myself having to spend 90% of the time fixing peoples' indentation.

Well, the thing is, most people find algorithms, etc rather boring. They want to be able to see results as fast as possible. They expect to be able to spend an hour or two and make Angry Birds. For this reason, at the moment I'm leaning toward just using CC with Mimic (hopefully GravityScore updates it soon :D/>). The drawing is very easy compared to 99% of other mediums and it's a good starting point. But, I'm welcome for further suggestions. Battery life is a fairly large issues, however.

Can't really help if the kids are supposed to be mainly not-going-to-work-hard-but-i-want-angry-birds type.
6677 #11
Posted 12 January 2014 - 06:56 AM
See I think pythons indentation is a good thing. Always good practise to indent your code no matter what language otherwise it has a tendancy to be unreadable (and as a result I hate reading some of the programs people post here because they seem to ignore the existence of indentation). No better way to teach them from day 1 to indent their code than to use a language where indentation is required.
theoriginalbit #12
Posted 12 January 2014 - 07:12 AM
See I think pythons indentation is a good thing. Always good practise to indent your code no matter what language otherwise it has a tendancy to be unreadable (and as a result I hate reading some of the programs people post here because they seem to ignore the existence of indentation). No better way to teach them from day 1 to indent their code than to use a language where indentation is required.
true, that is a good habit to put into people, but using a language that enforces different indentation levels with different compilers is not a good thing, 'cause more than anything it will deter them from the language - or even programming - due to its annoying nature. its just better to teach people from the very start about good indenting, its not a difficult task to perform, look at most students in my programming course, we all learnt with Pascal and C neither of which enforce indentation, but instead our lecturer drilled it into us for weeks on end, until eventually we were repulsed by ourselves when we did bad indentation, even on temporary or testing code…
one should not pick a language because of coding habits it enforces, one should pick a language based on how easy it is for people to learn and understand basic programming concepts that then can be applied to other languages, the easier the syntax the less time they spend on learning the syntax and the more time they spend on learning the concepts; that is where languages like Lua or Pascal come into play, they're very easy syntactically to pick up.
I'll see if I can find the PhD thesis/paper that my "Introduction to Programming" lecturer/professor wrote at the end of last year about teaching and methods of teaching programming to people who've no idea about anything programming related.
Edited on 12 January 2014 - 06:19 AM
6677 #13
Posted 12 January 2014 - 07:32 AM
See I think pythons indentation is a good thing. Always good practise to indent your code no matter what language otherwise it has a tendancy to be unreadable (and as a result I hate reading some of the programs people post here because they seem to ignore the existence of indentation). No better way to teach them from day 1 to indent their code than to use a language where indentation is required.
true, that is a good habit to put into people, but using a language that enforces different indentation levels with different compilers is not a good thing,
It doesnt force any particular indentation level. IronPython, Jython, PyPy Cython and CPython all allow different indentation levels for different source files as long as you are consistent with what the indentation level is.
CPython and PyPy the convention is to use 4 spaces for an indent, however if you consistently use 2 spaces it will not error, Google use 3 space indents (parts of their services actually use python, as does part of chrome OS excluding the python scripts already included in the linux underpinnings), I for awhile used tabs because I didnt realise I had GEdit incorrectly configured (forgot to turn tabs to spaces on), I did a test and the standard python interpreter was perfectly happy to take a 2 tab character indent for those who want to be truly obscure. Consistency is the key, choose what you want, just stick to it. Python will crash if you use tabs for the one indent yet use 6 spaces for another.
IronPython and Jython convention however is for a single tab character, I use IronPython with 4 spaces though.

python isn't fussy over what the indent used is, the principle above is actually written in one of the PEP documents somewhere.



With your comment on easy syntax, I fully agree, its just my belief is that Python also possesses the easy to pickup syntax required and that lua actually loses with basic programming concepts. No concept of seperate int or float and the table datatype is just utterly bizarre when compared with a simple list or array, I'm not saying they are bad, but I think again having the knowledge that an integer and a floating point are seperate things and knowing how to handle a conventional list or array might be more useful skills looking forward.
Edited on 12 January 2014 - 06:35 AM
Mads #14
Posted 12 January 2014 - 11:25 AM
Send them off to a flying start. Teach them C or C++.
oeed #15
Posted 12 January 2014 - 05:07 PM
I'll see if I can find the PhD thesis/paper that my "Introduction to Programming" lecturer/professor wrote at the end of last year about teaching and methods of teaching programming to people who've no idea about anything programming related.
That would be very useful if you have it.

Send them off to a flying start. Teach them C or C++.
Well, maybe after a term or so of Lua/something similar I'll probably switch to something like C, after they understand the basic concepts of functions, variables etc.
surferpup #16
Posted 12 January 2014 - 05:49 PM
Back in the day, we used to teach kids how to program with Apple Logo. Minecraft turtle programs are far superior in that regard, and I think Lua is an excellent first language. Even if you don't use Minecraft, Lua is available in runtime environments for OSX.
Bubba #17
Posted 12 January 2014 - 05:51 PM
Send them off to a flying start. Teach them C or C++.

I did this when I first started programming. It wasn't really a good idea.
Edited on 12 January 2014 - 04:52 PM
awsmazinggenius #18
Posted 12 January 2014 - 05:53 PM
Maybe try teaching them the LOVE 2D framework.

EDIT: Another two damn ninjas
Edited on 12 January 2014 - 04:53 PM
InputUsername #19
Posted 12 January 2014 - 06:27 PM
I agree with what has been said before; first teach them pseudo code and find out what kind of kids they are ("I want to learn" or "I don't want to do anything, but I want Angry Birds"). Then choose a language accordingly.

I think Game Maker is a good start (no hate please). It has basic drag-and-drop functionality to teach the basics of programming, but also has a language to program in. And like GM's creator said: the language (GML) is similar to other 'real' languages, so it's easy to switch when the you understand it.
ikke009 #20
Posted 13 January 2014 - 05:15 PM
There's a few things I would suggest. For the really young kids (13 or 14) I would suggest using microsoft excel or maple rather than a "real" programming language. I say this because excel is pretty easy to learn how to use, while giving them something they can actually do something with later in their lifes..

As for actual scripting, I would suggest using Love2D (lua). You can come up with a number of excercises/challenges ranging from easy to advanced. Consider using some half-finished scripts that the kids can complete as practice.
Love2D allows for relatively simple excercises, here are some examples:
-making a dot move from left to right on the screen
-making a dot move from left to right on the screen using the right arrow key
-making a dot move up/down/left/right on the screen using the arrow keys
-make a box in the screen where the dot can not move trough

Also for interactive teaching like this a whiteboard or beamer is a must. If you don't have access to this you're gonna have to write down examples on those 30+ computers individually to help those kids :P/>

Good luck and have fun, if you enjoy teaching as much as I do you're gonna have a great time :)/>
oeed #21
Posted 13 January 2014 - 06:17 PM
There's a few things I would suggest. For the really young kids (13 or 14) I would suggest using microsoft excel or maple rather than a "real" programming language. I say this because excel is pretty easy to learn how to use, while giving them something they can actually do something with later in their lifes..

As for actual scripting, I would suggest using Love2D (lua). You can come up with a number of excercises/challenges ranging from easy to advanced. Consider using some half-finished scripts that the kids can complete as practice.
Love2D allows for relatively simple excercises, here are some examples:
-making a dot move from left to right on the screen
-making a dot move from left to right on the screen using the right arrow key
-making a dot move up/down/left/right on the screen using the arrow keys
-make a box in the screen where the dot can not move trough

Also for interactive teaching like this a whiteboard or beamer is a must. If you don't have access to this you're gonna have to write down examples on those 30+ computers individually to help those kids :P/>

Good luck and have fun, if you enjoy teaching as much as I do you're gonna have a great time :)/>
The problem with excel is I believe the Mac version doesn't support Visual Basic anymore (at least I think so).

Love2D is a great idea though, I hadn't thought of that. Maybe after some basic Lua in CC well move on to that.

Most (if not all) of the interactive whiteboards are in the junior school (ankle height midgets to 12-13), but theres more than enough normal projects around the place.
6677 #22
Posted 14 January 2014 - 02:36 PM
The problem with excel is I believe the Mac version doesn't support Visual Basic anymore (at least I think so).

Love2D is a great idea though, I hadn't thought of that. Maybe after some basic Lua in CC well move on to that.

Most (if not all) of the interactive whiteboards are in the junior school (ankle height midgets to 12-13), but theres more than enough normal projects around the place.
VBScript is x86 windows only yes. Slightly buggy on x64 office even. Scrapped from the windows ARM port of office entirely and not included on mac either.

With my python bias: there is pygame too. Having not looked into love2d with my dislike of lua I can't say which is easier/harder. Personally I've found monogame to be the easiest graphics library though over time, but that wouldnt be suitable for the kids at all (C# or VB.net being harder and I wouldnt expect kids to understand the interface between ironPython and .NET libraries - which is possible by the way)
mrpoopy345 #23
Posted 18 January 2014 - 09:37 AM
Well, as an 11 year old, I can say python was the easiest for me to learn. Code.org does a good job of teaching, also.
awsmazinggenius #24
Posted 18 January 2014 - 02:18 PM
I like LÖVE too. Simple but can do advanced things. Try that with them.
oeed #25
Posted 18 January 2014 - 05:47 PM
I like LÖVE too. Simple but can do advanced things. Try that with them.

Yea, would you say it's easier or harder than CC?
ikke009 #26
Posted 20 January 2014 - 04:35 PM
Slightly harder than CC but CC seems very inapropriate to use as a proper teaching method, since CC is a game..
oeed #27
Posted 20 January 2014 - 06:40 PM
Slightly harder than CC but CC seems very inapropriate to use as a proper teaching method, since CC is a game..
I see where you're coming from, but I'd be using an emulator. CC it self isn't really a game, I just feel that going straight in to a game is a little silly.
ikke009 #28
Posted 21 January 2014 - 02:50 PM
A modification on a game is still a game imo..
also LOVE's graphic system is obviously 10000x better than CC's. Instead of making your students draw stuff trough cursor positions and pixel art you'll acutally be able to use a normal system.
If you're not very familiar with LOVE2D, goature on youtube has a very decent and in-depth guide on how to make a game with it.
oeed #29
Posted 21 January 2014 - 04:42 PM
Ok, I'll take a look at it.
Jguy #30
Posted 21 January 2014 - 04:42 PM
I've been rather successful on starting people out on Python. While the indentation requirement for different blocks of code it teaches people to indent, which is sadly what some programmers lack even after "going to school", their indnetation isn't correct.

Python also has the benefit of not needing line closing and the if, elif else structure is easy to grasp. You also don't need to declare variables like you do in C (int f, char t, etc.) and function defining and usage is easy and flexible.

Out of all of the programming languages I have under my belt I tend to pick up Python for any simple to do stuff most of the time. It was also fairly easy; I taught myself most of the basics in a few hours, while I still don't have a full grasp on C or C++.
Edited on 21 January 2014 - 03:43 PM
H4X0RZ #31
Posted 21 January 2014 - 06:44 PM
I would teach them java. First the basics, then, if they know enough, I would try some 'practical' stufg with the bukkit api and a craftbukkit server. You can learn much from bukkit imo :D/>
Maybe you set up a bungee server which has access to every student's local server. Then they can show their friends what they are able to do with bukkit in minecraft :D/>

At the end you get them to code a big minigame which they then play :D/>
Agoldfish #32
Posted 21 January 2014 - 07:09 PM
I first got into coding from this mod, and Codeacademy. Codeacademy is a wonderful website, with some starter languages like Ruby, Python, JavaScript, and some other ones I can't remember. I'd try that first. :)/>
awsmazinggenius #33
Posted 21 January 2014 - 08:18 PM
LÖVE is actually a little bit like CC in some ways. And you shouldn't teach them one drawing method, and then make them use a different one (same with the other functions in LÖVE and CC). I would use LÖVE.
oeed #34
Posted 22 January 2014 - 03:51 AM
I've been rather successful on starting people out on Python. While the indentation requirement for different blocks of code it teaches people to indent, which is sadly what some programmers lack even after "going to school", their indnetation isn't correct.

Python also has the benefit of not needing line closing and the if, elif else structure is easy to grasp. You also don't need to declare variables like you do in C (int f, char t, etc.) and function defining and usage is easy and flexible.

Out of all of the programming languages I have under my belt I tend to pick up Python for any simple to do stuff most of the time. It was also fairly easy; I taught myself most of the basics in a few hours, while I still don't have a full grasp on C or C++.
Quite a number of people on this topic (almost 50%) have recommended Python. I personally haven't had much of a look at it, but I probably will.

I would teach them java. First the basics, then, if they know enough, I would try some 'practical' stufg with the bukkit api and a craftbukkit server. You can learn much from bukkit imo :D/>
I tried making an Inception mod for Minecraft a while ago, it was the first time I used Java. At let me tell you, it's probably the last. The arrays/dictionaries/tables and the most ridiculous rubbish I've ever seen. Words can not describe how much I hate them.

LÖVE is actually a little bit like CC in some ways. And you shouldn't teach them one drawing method, and then make them use a different one (same with the other functions in LÖVE and CC). I would use LÖVE.
Once I've finished my top secret project I'll take a look at LÖVE, I've got a lot on my plate at the moment so I don't really have time for it.
6677 #35
Posted 22 January 2014 - 08:17 AM
A java array kinda works like an array in just about every other programming language except lua…




Oh. For python + games you get pygame.

With python rather than asking what you can do its better to ask what you can't do :P/> The answer to that pretty much consists of the usual standard answer for interpreted languages which is "anything that needs to be incredibly quick".

I still think python meets your requirements best, you mentioned not wanting to install things and I think that the systems being used were macs. Just open the terminal on OSX and type "python" and your straight into the interactive Python 2.7 interpreter.



You also mentioned javascript. Take a look at node.js which is pretty much a standalone javascript runtime (actually forked from chrome-v8 which is pretty high performance) allowing you to use javascript as a normal alternative to python or lua without any reliance on the browser. There are graphics libraries etc available for it too. I actually had it running as a crude serial terminal (talking to a stellaris launchpad over bluetooth) on the windows command line a few days ago.
oeed #36
Posted 22 January 2014 - 05:14 PM
Macs don't come with Python, but it shouldn't be too hard to install.

The main issue is I don't want to teach a language I don't have much experience with.
6677 #37
Posted 22 January 2014 - 05:44 PM
Macs don't come with Python, but it shouldn't be too hard to install.

The main issue is I don't want to teach a language I don't have much experience with.
Yes they do….. I already told you how to launch it and regularly do it in the apple store just to piss the staff off (the so called apple genius staff are usually rather thick and don't know how to deal with a terminal window running a simple counter program)

From python:

Python on the Mac

Python on the Mac has the ability to work with
and much much more of the Mac infrastructure!

Python comes pre-installed on Mac OS X, but due to Apple's release cycle, it's often one or even two years old. The overwhelming recommendation of the "MacPython" community is to upgrade your Python by downloading and installing a newer version from the Python standard release page.

If you are using Mac OS X 10.5, see the Leopard wiki page for detailed information.

If you're just curious…

You don't have to download anything. You can run a Python interpreter by double-clicking on Applications / Utilities / Terminal (here's a picture), then typing "python" into the window that opens up.

You'll see a prompt that looks like this:






Last I checked on my dads mac it was 2.7.3 and I think a bit newer on mavericks (off the top of my head I think the most recent python 2 release is 2.7.5)
awsmazinggenius #38
Posted 23 January 2014 - 08:34 PM
For Python, I saw this book called "Python for Kids" in the bookstore when I was browsing there today. I looked through the first couple of pages for you, and apparently there is a website if you want to look. http://python-for-kids.com/
oeed #39
Posted 23 January 2014 - 09:58 PM
For Python, I saw this book called "Python for Kids" in the bookstore when I was browsing there today. I looked through the first couple of pages for you, and apparently there is a website if you want to look. http://python-for-kids.com/

That looks great, thanks!
6677 #40
Posted 24 January 2014 - 04:29 PM
Huh sweet.

Another python related help source. There are quite a few programming guides revolving around python on the raspberry pi, many of which are child friendly. Thanks to the cross platform nature there isn't actually anything pi specific on some of them (a few of them do things like blinking LED's etc which uses a raspberry pi specific library, besides you dont have a GPIO port on your mac or PC to attach said LED). Might require a bit more effort on your behalf to sort the rubbish from the great, but there should be some useful resources out there.
Edited on 24 January 2014 - 03:30 PM
awsmazinggenius #41
Posted 24 January 2014 - 10:18 PM
I meant that book as a guide for how to teach Lua (what you need to explain etc.), not for Python, really. Though I guess that' s not how it came across, though.