Slashdot Mirror


How To Teach a 12-Year-Old To Program?

thelordx writes "I've got a much younger brother who I'd like to teach how to program. When I was younger, you'd often start off with something like BASIC or Apple BASIC, maybe move on to Pascal, and eventually get to C and Java. Is something like Pascal still a dominant teaching language? I'd love to get low-level with him, and I firmly believe that C is the best language to eventually learn, but I'm not sure how to get him there. Can anyone recommend a language I can start to teach him that is simple enough to learn quickly, but powerful enough to do interesting things and lead him down a path towards C/C++?"

14 of 799 comments (clear)

  1. Re:Python by Anonymous Coward · · Score: 2, Interesting

    You may actually want to be a little wary of languages like Python if you plan on teaching a kid C. It's a trap that I, as a young programmer, fell into with classic Visual Basic: the language is just enough that you get hooked on it and don't want to move on to something else. That's an important reason, at least in my book, why starter languages should be limited in their capabilities—that, and it makes a great learning experience for the kid to come back and complete his or her favourite language later!

    tl;dr: Python is a great language to learn by, but so featureful that your kid may never give it up.

  2. Parallax Propeller micro controller kit. by twisting_department · · Score: 2, Interesting

    Get him a Propeller micro controller kit from Parallax Inc http://www.parallax.com/tabid/407/Default.aspx A Propeller is a 32 bit micro-controller (well in fact 8 processors in a chip) with some RAM. Parallax have a number of ready made boards so that this thing is easy to program from USB. The IDE is dead easy to use. Starting out the first steps in programming with this is inspiring because one can immediately get things in the real world to happen. From flashing LEDs to controlling robots, to generating video. The high level language it uses, Spin, is sort of Pascal/Python/C like, very easy to begin programming with. When you get serious it's assembly language is about the easiest there is. The Propeller does VGA and TV video, there is even a games oriented kit. It's the closest thing we have to the C64 we have in this modern world. Wish I had one when I was 12.

  3. FreeBASIC by duke4e · · Score: 2, Interesting

    I whould go with FreeBASIC (+FB IDE) It's open source, it's fast, it's pretty close to QBasic, but has pointers, OOP and all other modern language stuff. Also, tons of libraries are supported (OpenGL, etc...)

  4. Re:Programming by 0xygen · · Score: 3, Interesting

    Interestingly along those lines someone has created a low-entry-barrier BASIC type language. Check out http://kidbasic.sourceforge.net/

  5. Re:plain C, python, or ruby by tomhudson · · Score: 4, Interesting

    IMHO everything is wrong with C as first language. It gives you dreadful programming style and is not a right tool for application programming. You can mod me as a troll if you want but you've got to chose the best tool for the job and C is a tool for writing operating systems for fuck's sake. It isn't even a high level language. All those buffer overflow security holes happen because of both typical "clever hack" C programming style and choice of using a language for writing operating systems to write business applications.

    So teach him assembler as a first language, and EVERYTHING else will look simple in comparison!

    Seriously, start him with either the java console (system.out stuff) so he can do "Hello, world!", or start him with html+javascript.

    Programming today isn't like when we were kids. In those days, you did whole applications with ONE technology and ONE package - dbase, clipper, turbo c, delphi, dbfast ...

    Now? The database is decoupled from the app logic. The app logic is decoupled from the presentation, which could be a program or a web app. We wanted separation of the storage from the logic from the front end, and we're there. The kid will get more fun doing simple web pages that he can see results in right away (important to get that positive feedback going, or he'll go back to his psp or wii or xbox or whatever). html+javascript gives him that, plus you don't need anything to start except a web browser and a text editor, - not even a web server.

  6. Lego Mindstorms by ebbe11 · · Score: 3, Interesting

    It must be fun, otherwise he won't continue doing it. And building robots and making them do things is fun. But there is of course a price to pay - literally.

    --

    My opinion? See above.
  7. Re:javascript by Phroggy · · Score: 2, Interesting

    It's a web programming language, not something a 12 year old should be using to have fun messing around and maybe trying out some 3D stuff.

    That hasn't stopped people from trying out some 3D stuff.

    --
    $x='S24;r)>63/* h@<5+oZ)32"5cz';$me='phroggy'x$];
    $x=~y+ -xz+\0-Tx+;print$_^chop$me for split'',$x;
  8. HTML and Javascript by Eravnrekaree · · Score: 2, Interesting

    Seriously, start with HTML. It gets you instant results right away and he can see his work coming to fruition quickly in designing his own web pages. To really capture interest it can help to show the practical purposes of programming rather than making iot all so abstract. Lots of set up and initialisation just to do something can really blow out many new programmers, if there is a lot of tricky work to do simple things. HTML and javascript allow you to see results fast with little initialisation crap. Instant gratification can help capture their interest and the web page thing allows them to quickly realise the value of what they are doing. Write some HTML and publish it on myspace or on fortunecity for the world to see, tis instant payback.

    Start to teach javascript and you get instant feedback. Javascript happens to be a very simple, clean, dynamic typed language perfect for a newbie. Show them how to use the javascript and debug console in firefox to debug their code. More instant gratification from making their own little web applets that can be made instantly available to world .

  9. Re:small asm, C, C++, python - in that order. by squidfood · · Score: 2, Interesting


    Followup to my last post: another suggestion in asm-type space (if you don't want to start with electronics) is to download a corewars emulator (or perhaps a similar Robowars type game) and beat each other up in core/logic space for a while. I remember a real "aha" when I learned about Imps, Dwarves, and self-modifying code in general that way.

  10. Does no one get it? by fractalboy · · Score: 2, Interesting

    Poll a few hundred English lit professors about which one novel you should start with to get a kid into the classics and you are going to get a few hundred very different and extremely opinionated answers. Put them all in the same room, and you'll get a lot of interesting arguments about it too.

    My opinion? I've taught kids aged about 8-17 programming languages at summer computer camps for over 10 years, and I have otherwise been an educator for a while. Despite my own preferences and opinions, the truth is that unless you try to start someone out on INTERCAL, language doesn't matter. It's not like Bobby would have become a phenomenal programmer, except you erroneously chose Language X to start him off with, and he hated it, so he became a hair stylist instead.

    If someone doesn't do well at all with C++, while BASIC for example might be less scary, in my experience it makes no difference to reapproach programming with the different language. At least as far as making a difference between having a real interest/performance, and the distinct lack thereof. If someone is going to "get" programming, they'll be able to get it with any common programming language. Period.

    Furthermore, a kid's understanding of a programming language is going to depend much more on the quality of the tutoring/teaching/etc. methodologies, but that's another topic for another time.

  11. I've built an 80s era 'lab' to teach my son by RonMcMahon · · Score: 2, Interesting

    I hate the fact that there is SO much intermediation between the keyboard and the actual machine in our current computing environment (when it comes to teaching the fundamentals of computer programming). I doubt that our programming models will ever actually return to the intimate connection to hardware of the 80s, which is fine, but when it comes to teaching the fundamentals of the interaction between the instructions and the actual machine / chips there is a lot less between you and the machine when developing in an 8-bit world. A single wrong character can bring the whole system to a halt, or cause really unexpected behaviours that are often not seen in our compiled / checked / verified modern programming environments. There is also a lot less help from the system in developing, so if you do take to it, it is because you enjoy the challenge despite the obsticles and clear limitations of 20-year-old hardware.

    I've built up a 'lab' with old Atari, and Commodore 8-bit machines. My son is learning Atari and Commodore Basic and Atari LOGO. For Christmas he wrote a Christmas greeting in Atari LOGO, which really required him to dig in to recursion and integrating the application's behaviour in to an internal mental model, so I'd call this approach a success.

    I find it interesting to see the comments on PYGAME here...I'll have to investigate as eventually I'll want him to move to the next level where he is using 'modern' languages once he groks the basics and wants to do something that he can share with his peers via email.

  12. Re:Python by hazem · · Score: 2, Interesting

    There's actually an interesting Agent-Based Simulation system based (loosely) on Logo called NetLogo (http://ccl.northwestern.edu/netlogo/). You can do basic Logo stuff, but it can actually do some very sophisticated modeling and the syntax is not very difficult.

    Using syntax similar to Logo, you have program agents to sense their environment and then take action based on that. The concepts scale well to other platforms like the Lego Mindstorms.

    It's not a traditional programming environment but as a beginner you'd still need to understand the idea of variables, objects, and conditional logic. Plus it's very visually oriented and has many examples that a kid can play with and tweak.

  13. Getting their interst with simple fun by darthlupi · · Score: 2, Interesting

    If you don't mind giving the youngster a somewhat graphical and simple approach to programming, I highly suggest using Game Maker. It is a graphical game creation tool that also includes it's own scripting language that is very easy to get a hang of.

    One of the more interesting aspects is that anything that is done with the icons or Drag and Drop items can be done through scripting creating a nice staged approach to learning programming.

    It was created by a professor named Mark Overmars as a teaching tool to get children interested in programming.

    http://www.yoyogames.com/gamemaker/

    It has very basic OOP functionality built in with child and parent objects, and you can actually create some pretty interesting applications with it. The problem is that is a bit too fun and you will need to encourage your child to use this solely as a launching pad and not a final destination.

  14. Re:GNU Robots is a great start by Jim+Hall · · Score: 2, Interesting

    Thanks!

    Actually, the original plan was to use a simplified version of assembly (based on 6502 assembly) to construct your robot. But I quickly realized two things:

    1. I was spending way too much time writing and debugging my interpreter
    2. It was becoming much too complex to write a simple robot program

    I think you'd have the same problem with C or C++.

    So I looked around for another way to do it, and found the Scheme interpreter (GNU Guile). Since my Robots program was already being written under the GNU GPL, GNU Guile seemed a perfect fit. It had all the hooks to make writing the rest of the Robots game easy, and users would be able to write programs in a language that already existed. From there, RMS accepted my Robots game as "GNU Robots".

    The down-side was that I know nothing about writing LISP or Scheme programs, so when I was done writing GNU Robots, I couldn't create any robot programs with sophisticated algorithms. Bummer. That's why my demo robot programs in GNU Robots 1.0 were so simple.

    I envisioned that someone would help me create a tile-based programming concept, where "actions" were represented by "tiles" (for example: "move forward", "turn right/left", "pick up object", "fire gun", ...). The programming GUI (basically an "IDE" for a GNU Robots program) would let you connect tiles to each other using "wires" (in the resulting Scheme program, it would be tail-recursion, similar to a "GOTO".) There'd be certain "if" tiles that would let you branch to other tiles (probably a combo tile like "look ahead, if enemy less than _ squares away..").

    Alas, I wasn't able to pull that together. It's still not there, AFAIK, so if anyone wants to write such a thing, I'm sure the current maintainer would thank you.