Slashdot Mirror


Ask Slashdot: Best Book For 11-Year-Old Who Wants To Teach Himself To Program?

New submitter waferthinmint asks "What is the best book for my son to use to teach himself to program? He wants to study on his own but everything seems to assume an instructor or a working theoretical knowledge. He's a bright kid but the right guide can make all the difference. Also, what language should he start with? When I was in HS, it was Basic or Pascal. Now, I guess, C? He has access to an Ubuntu box and an older MacBook Pro. Help me Slashdot; you're our only hope."

38 of 525 comments (clear)

  1. Python by Anonymous Coward · · Score: 5, Informative

    Have him learn python. On any OS.

    1. Re:Python by LifesABeach · · Score: 4, Funny

      Junior could just "Google" his questions. My daughter says Google holds all lifes answers.

    2. Re:Python by chaosite · · Score: 5, Informative

      I second the python recommendation. Have a look at this (free, available in dead tree format as well as online) book:

      http://www.greenteapress.com/thinkpython/

    3. Re:Python by Githaron · · Score: 4, Informative

      Have him learn python. On any OS.

      If you are going to teach him Python, have him take CS101 at Udacity. It is more fun than reading a book.

    4. Re:Python by durrr · · Score: 4, Informative

      Have him learn Ruby. On any OS.
      With this book: http://www.ruby-doc.org/docs/ProgrammingRuby/

    5. Re:Python by g0bshiTe · · Score: 4, Informative

      I'll 3rd that.

      Have a look here. http://www.pythonchallenge.com/ I know it's been around forever and a day, but some challenges like this will show him there are practical applications to what he is learning.

      --
      I am Bennett Haselton! I am Bennett Haselton!
    6. Re:Python by chaosite · · Score: 5, Funny

      Nah man, snakes are cool. "Playing with Ruby" makes it sound like your eleven-year-old hired a whore, or perhaps a drag-queen.

    7. Re:Python by CaptainLugnuts · · Score: 3, Interesting

      It would probably be more fun to set up an 8-bit emulator for the Atari or C64 machines and turn them loose on BASIC there. There's tons of old magazine listings to type in and learn from. It's also nice that it is possible to learn everything that is happening on the (simulated) machine. Being able to POKE a memory location with a value and see immediate changes helps bring about the A-HA! moments.

    8. Re:Python by jcreus · · Score: 5, Informative

      Hi. Teenager here. I learnt how to program when I was about 11 (or maybe 10), self-taught. My best recommendation: let him learn how to program by himself. What I did was, and I've done such a thing for all programming languages (8, I think) I know: first, go to the first tutorial you see on the Internet. I believe I used Wikibooks (Python). And, then, leave the tutorial after knowing just the basic I/O and simple statements. Then, give yourself a project. For example, I created one which solved me the maths homework. Something you find useful. And, while doing that, one must learn more features of the language. In case you have doubts, be self-sufficient: just f*cking google it, and results will appear (learning how to google is probably a priority before programming languages!).

      So, what you said is true. Don't spend money on programming books. Let him learn by himself.

      On the other hand, regarding programming languages, I've always loved Python. Simple syntax, easy to introduce to new programmers, no pointers, great power... Furthermore, while Python keeps being my favorite, maybe, for "the current times", he would find JavaScript (+HTML+CSS) closer, for he would be able to create his own websites and that's something you often feel proud of ;). Also, it seems now everything has to be JavaScript-based...

    9. Re:Python by jellomizer · · Score: 4, Insightful

      As a seasoned adult developer who learned to program as a kid.  There is just one word of advice. Just because you know the language it doesn't make you a writer.  While learning by yourself if actually very useful, don't mistake it from the structured stuff you get in college.  I spent a good part of college de-conditioning myself with my bad habits because they worked, and with the good habits learned there was much less funny acting code, and the code ran more reliability and was easier to change.

      When I entered college I know how to program in about 8 languages (before Google) myself, I was actually codding professionally before I left for college too.  And the skills I taught myself was valuable, and gave me a heads up in College as I wasn't fretting over the technical end, and I could put the rest of my focus on good form.
      I have seen some other kids wash out of the computer science program because they knew how to write code however their egos got in the way and they never wanted to unlearn their old ways.  They will still stick on the superiority of the GOTO statement.

      --
      If something is so important that you feel the need to post it on the internet... It probably isn't that important.
    10. Re:Python by msclrhd · · Score: 3, Informative

      Python, Ruby or some other similar scripting languages are great to start on and build up an understanding -- they allow you to start small and build up an understanding of what you are doing without any "noise".

      The Khan Academy has programming videos oriented around Python (http://www.khanacademy.org/#computer-science), not sure how good they are but the Math videos are good so it'd be worth checking out.

      An advantage of python is that if you run it from the command line on its own, you get an interpreter where you can start typing commands and seeing the results (e.g. 2+5 'hello world'.split(' ') ':'.join(['a', 'b']) ).

      The other language mentioned here is JavaScript. The main problems with starting with JavaScript as a language is what other non-scripting languages suffer from: there is a lot you have to do to get up and running (there is nothing like hearing "just ignore the public static void bit for now" when learning to program) -- especially when you have to read a different markup (html) to get started.

      If you do decide to go down the JavaScript route, use something that makes it interactive and fun. See the "Bret Victor - Inventing on Principle" video (http://vimeo.com/36579366) for a good idea on that w.r.t. the 2D drawing APIs where you have the JavaScript on one side and the picture it generates on the other and what you change on the JavaScript side gets immediately picked up on the picture side. See http://gabrielflor.it/water for an implementation of this!

      More generally, a good choice to start with is something that gives you decent feedback quickly and something that allows you to experiment and have fun with it.

    11. Re:Python by CCarrot · · Score: 4, Funny

      When I entered college I know how to program in about 8 languages (before Google) myself, I was actually codding professionally before I left for college too.

      Hmmm...sounds a bit fishy to me.

      --
      "I love animals! Some are cute, others are tasty, what's not to like?" - Betsy Schroeder, Jeopardy contestant
    12. Re:Python by dvice_null · · Score: 3, Insightful

      I also learned programming myself, over 15 years ago. Yet I have still today learned a lot of useful stuff from others who I have worked with.

      This is what I think:
      - If he is motivated to learn by himself, that is the best way to start. Not because of what you learn about programming, but because of what you learn about learning and studying new stuff.

      - After a year or so, if possible, get a good mentor. This time, to learn about programming. There is a lot of advanced topics which you don't even know to exist unless you have a really good book or a really good mentor. This doesn't mean that you couldn't study this stuff by yourself, but you will need someone to tell you what to study. Here is a list, which contains topics, perhaps a bit too advanced for someone who just started to program, but the list contains a lot of things I wish someone had told me sooner:
      -- unit testing (more important than the program itself),
      -- more about testing and what you can do with it, e.g. performance testing
      -- pair programming
      -- writing clean code (e.g. why it is important that you think really hard how to many each variable you create),
      -- refactoring (how you can do it and why you should),
      -- programming principles and patterns (e.g. why a class or a function should have only one responsibility),
      -- usability (how you can analyse it and improve it),
      -- user experience (why people think that the software is faster and has less errors just because you changes the error messages more polite),
      -- tools(version control, IDE, continuous integration with static and dynamic analysis, and how they can help you do your job).
      -- Agile methods, lean, kanban. (these are pretty good to know when you start working for real)

      My recommendation for language: Python with pygame (for writing games).

    13. Re:Python by Tassach · · Score: 5, Insightful

      Also being a 'seasoned' developer I'm wondering why not a 'real' language like C as opposed to scripting languages.

      Dynamic (scripting) languages are no less "real" than compiled languages. Both have their place, their strengths, and their weaknesses, which is something a "seasoned developer" should know.

      An instruction language should just get out of your way and let you concentrate on doing stuff and understanding the CONCEPTS, instead of concentrating on making the compiler/interpreter understand you or doing routine housekeeping (eg: memory management). This is true for real-world development, but is especially relevant when teaching someone how to program. For this reason, Python is an excellent choice as a first language -- even MIT uses Python as a teaching language. (I can't think of a better endorsement than that)

      The advantage that Python has over other dynamic languages (Perl, Ruby) is that it is designed for readability and clarity. Even as a die-hard Perl programmer, even I can admit that Python is an easier language to learn and explain, and is probably the first language I'll teach my children. Whether it's (IMHO) dumbed-down syntax is an advantage or a disadvantage for doing serious work is a subject of debate (if not holy wars).

      C is a wonderful language for a specific class of problem, but it has lots of problems that make it suboptimal (if not completely unsuitable) for other tasks. Knowing *when* to use C (and, more importantly, when *not* to use it) is as important as knowing *how* to use it, if not more so. It is not a good teaching language for a beginning programmer, any more than it is a good language for general application development. Someone who doesn't understand this has no business calling themselves a "seasoned developer".

      --
      Why is it that the proponents of "one nation under God" are so eager to get rid of "liberty and justice for all"?
    14. Re:Python by Smallpond · · Score: 3, Funny

      Today I had to tuna database, then I was supposed to do some ray tracing but I floundered.

    15. Re:Python by Gorobei · · Score: 4, Interesting

      C will teach you how computers work.
      Python will teach you how programming works.

      Ideally, you want to know both. The question is just which one you want to learn first (and if you even want to learn about the other one.)

      There's no right answer. My 8 year old daughter figured out Universal Turning Machines from watching minecraft videos*. If she wants education I'd probably teach her Python. But I could also see showing her NAND gates, working up to a general purpose computer, then C. It's all about her interests and aptitude.

      * She ran into my room excitedly to say: minecraft runs on a computer. I can build a computer in minecraft. So it could do minecraft. I probed a bit, and she explained that it was just like a book ("Diary of a Wimpy Kid" was her example) referencing the book itself by name. Of course, her current career choice is helicopter door gunner, so nothing may come of this.

  2. Datasheet by Matt_Bennett · · Score: 4, Funny

    Print out the datasheet for a microcontroller and hand it to him. It might discourage him, but you could just be creating a prodigy.

    1. Re:Datasheet by Quaoar · · Score: 4, Funny

      Or the Unabomber...

      --
      I'll form my OWN solar system! With blackjack! And hookers!
  3. codeacademy.com by Anonymous Coward · · Score: 3, Informative

    I'm an experienced programmer, but I really liked the step-by-step stuff on codeacademy.com, where the language du jour is javascript, actually.

  4. Normally C but... by danwesnor · · Score: 4, Insightful

    For an 11-year old who's learning, I can't imagine C is a good fit. He'll want to spend his time making working code and not chasing crashes. Something safer.

    1. Re:Normally C but... by Anonymous Coward · · Score: 5, Funny

      Isn't that how Bill Gates got started? Look what that got us.

      Yes, but look at what that got him.

    2. Re:Normally C but... by tool462 · · Score: 4, Interesting

      I disagree. I was 10 when I started programming, and when I did it was in C. There are some advantages in being close to the hardware like you are with C, as opposed to the higher level languages like Java, Perl, Python, etc. Just like how everyone learns arithmetic by hand to start, but once that's mastered most people just use a calculator for anything they can't do in their heads. Without learning the manual process first, you wouldn't understand the guts of how arithmetic works. The calculator would just become a magic box that spits numbers out at you.

      Just like with math I MUCH prefer to spend my time in a high level language like Perl or Python, but I'm much better at using them because of my early experiences with C. An example:

      One of the early C programs I wrote was an implementation of Conway's Game of Life. It's a fairly simple program, conceptually, but it hits a lot of major gotchas in programming. At by "it", I mean me :)
      - array bounds checking
      - data integrity (you have to have a buffer array to create the next generation or you'll get very screwy results)
      - array copying (pointers are both powerful and dangerous)
      - static vs. dynamic memory allocation (free your pointers, kids)

      All of these things can cause issues in most programming languages, but the bugs they cause can be a lot more subtle in some of the higher level languages.
      Consider a one-dimensional array
      C-style
      int a[3] = {1,2,3};
      int b[3];
      b = a;
      a[1] = 5;
      *** b is now {1,5,3}

      Perl style
      @a = (1,2,3)
      @b = @a;
      $a[1] = 5;
      *** b is still (1,2,3)

      For this, Perl seems better since it matches what the user likely wanted to do.
      However, now look at 2d:
      C-style
      int a[3][3] = {{1,2,3},{4,5,6},{7,8,9}};
      int b[3][3];
      b = a
      a[1][1] = 10;
      *** b[1][1] is also 10

      Perl-style
      @a = ([1,2,3],[4,5,6],[7,8,9]);
      @b = @a
      $a[1][1] = 10
      *** $b[1][1] is ALSO 10

      Why the difference? Array assignment in perl only copies the top level structure, which happens to consist of array refs in the second case. So after the assignment both $a[1] and $b[1] point to the same array ref. If you're already familiar and comfortable with C pointers, this kind of bug is a lot easier to find and fix. You're less likely to make this mistake anyway, though, because you have that intuition that array copying is a hard thing to implement and that different languages will do so differently. So if you need to copy some kind of complex data structure, you better look into how that particular language does it.

  5. A plug for Alice by crazyjj · · Score: 4, Interesting

    I would like to put in a plug for Alice as a great introductory language and IDE too. Unlike a lot of introductory languages, it teaches actual object-oriented programming, and it's fun to boot.

    --
    What political party do you join when you don't like Bible-thumpers *or* hippies?
    1. Re:A plug for Alice by crazyjj · · Score: 4, Interesting

      I should also mention that there are a bunch of books available that will help with it too.

      I would also urge you to ignore all the "If he can't start out with the hardest stuff, he doesn't belong in our fraternity" snobs here who are recommending you try to get your kid to learn stuff like C, and Python hand-coding right out of the gate. If you subject him to that, not only are you setting yourself up for child abuse charges, but you're probably going to turn him off to programming for good. He should learn the principles first (which Alice teaches in a fun way), and save the hard stuff for when (and if) he's ready to pursue it further..

      --
      What political party do you join when you don't like Bible-thumpers *or* hippies?
  6. Hello World! Computer Programming for Kids and Oth by LordNimon · · Score: 3, Interesting

    My nine-year-old is using "Hello World! Computer Programming for Kids and Other Beginners" to learn Python. She's not really very motivated, though.

    http://www.amazon.com/dp/1933988495

    --
    And the men who hold high places must be the ones who start
    To mold a new reality... closer to the heart
  7. Find out why. by JustAnotherIdiot · · Score: 3, Informative

    Different languages excel at different things, so It's probably a good idea to figure out what he plans on doing with programming knowledge.

    --
    What do I know, I'm just an idiot, right?
  8. I am self taught by Anonymous Coward · · Score: 3, Interesting

    I am a self taught programmer. For me it started with video games which I practically grew up on. My mom bought a nintendo to keep busy while staying at home with her new baby. I started playing before i could walk, and my interest was sparked when I basically said "Who set these rules, what if I want to jump higher or have more bullets". My parents got me a Vtech computer from walmart for ages 9 and up. I was 6. It had a single line text-only display with 20 characters. But it had BASIC on it and I learned it myself through reading the book.

    Get him going on BASIC. It's not out of date.

    C has way too much involved features that would confuse him. Scoping, inheritance, pointers, etc.

    Get him to the point of writing a small text based battle system. That's what I first wrote as a kid.

    "You encounter the enemy, who has 20hp"
    "Press 1 to punch, 2 to kick, 3 for magic list"
    1.
    "You punch the enemy doing 7hp damage, he has 13hp left"
    "The enemy kicks you dealing 12hp damage, you have 12hp left"
    "Press 1 to punch, 2 to kick, 3 for magic list"
    3
    "Magic list"
    "1: fireball"
    "2: heal"
    "3: whatever"
    1
    "You shoot a fireball doing 13hp damage."
    "THE ENEMY IS DEAD, YOU WIN!"

  9. Mobile by CharlyFoxtrot · · Score: 4, Interesting

    I don't know about a book but I'd teach him Objective C or Java. Something you can use to create an app for a mobile device. There's nothing like being able to carry your work around with you in your pocket and showing it off to people. Personally I'd go for Objective C because making a UI in Xcode is quick and easy and you can then focus and the real coding.

    --
    If all else fails, immortality can always be assured by spectacular error.
  10. Free Python Book by reiserifick · · Score: 3, Interesting

    I highly recommend "Learn Python the Hard Way". Best of all, the online HTML version is free! (as in beer) http://learnpythonthehardway.org/

  11. Perl rocks! by swm · · Score: 5, Funny

    Learning Perl
    Schwartz & Christiansen

    Or just send him to http://perldoc.perl.org/

  12. If using Python... by CJSpil · · Score: 5, Interesting

    You might want to check out the book Snake Wrangling for Kids

    --
    For people who like peace and quiet. A phoneless cord!
  13. Lego Mindstorm by mrops · · Score: 4, Interesting

    If he is 11, get him lego mindstorm. Out of the box it comes with a UI that lets you do logic and control your lego creations. Once he gets the concepts of loops and ifs, wipe the firmware with community Java firmware (lejos) where he can write Java code to control his mindstorm bots.

    By this time he would have bootstraped himself into programming and internet would be enough.

  14. Re:Head First by ShieldW0lf · · Score: 5, Interesting

    Set him up with Scratch.

    http://scratch.mit.edu/

    I taught my daughter to program using it. It uses most if not all of the standard logical constructs, but instead of having to type and debug code, you drag and drop, attaching little lego-brick looking things together. It lets you focus on logic errors instead of syntax errors, and makes it a lot more accessible.

    Also, you can log in to the scratch website and publish from within the Scratch IDE. This was a major source of encouragement for my kid, who is more driven by the appreciation of her peers than by the achievement itself. After our game got featured on the front of the website and over a hundred kids posted comments about how cool she was, it stopped being a way to spend time with Dad and became something exciting in its own right.

    You can also download other kids programs, open them in the IDE and see exactly how they work. If you then create a derivative work and publish it, that will all be preserved... anyone looking at your program will be able to identify that you made it, what it was derived from, and who made the original. So, it teaches them to share, too, and helps them learn from each other.

    Once he gets deeper into it, you can buy him some hardware and he can use scratch to control that. It's compatible with Lego, and also with the PicoBoard:

    http://www.picocricket.com/picoboard.html

    --
    -1 Uncomfortable Truth
  15. Why's Poingnant Guide to Ruby by jtara · · Score: 3, Informative

    For an 11 year old? That's easy: Why's (poignant) Guide to Ruby

    Just make sure you stock-up on chunky bacon.

    (Multiple formats linked from the Wikipedia article)

    http://en.wikipedia.org/wiki/Why's_(poignant)_Guide_to_Rubyhttp://en.wikipedia.org/wiki/Why's_(poignant)_Guide_to_Ruby

  16. LOGO / Turtle Graphics by N0Man74 · · Score: 3, Interesting

    Have you considered LOGO (or Turtle)?

    It helps teach some basic concepts, while at the same time giving more feedback (which is good for kids). BASIC on a TRS-80 Color Computer and LOGO on a TI-99 4A were 2 of my earliest introductions to programming. I also learned about logic through some very old game that used many types of logic gates to solve various puzzles involving flow of power (I wish I remembered the name).

    You could also pick up a copy of the board game Robo Rally, which is an amusing game that involves planning and visualizing instructions that you will be executing at a later time (with lots of uncontrolled variables screwing things up). While not being like actual programming, it's a fun way to exercise some of the types of thought patterns involved.

    In my opinion, at that age, the choice of Language isn't really as important as just some of the basic ideas involved, such as sets of instructions, iterations and control structures, and logical decisions.

  17. Re:Art of Assembler by ArhcAngel · · Score: 4, Interesting

    what's funny is I got hooked on programming by typing in the machine code/assembler programs from the back of Byte (or was it Compute!) magazine on my C64. I'd wait for each new issue and sit at the keyboard for what seemed like hours to see what I could "create" I had no clue what I was actually typing in but the fact that I put it in the computer and it did something meaningful led me to investigate it further and eventually I took an advanced math class that was basically a 7th grade computer programming class. ( Ah that TRS 80 and BASIC! ) By the time I got to high school I went for C/C++ ( IBM ATs in class and an Atari 1040 STe @ home ) I thoroughly enjoyed breaking down the logic and figuring out how to have a computer do what I wanted it to do. Then reality set in. I got a job...programming! It was never as much fun after that.

    --
    "A person is smart. People are dumb, panicky dangerous animals and you know it." - K
  18. And for the reading by Hentes · · Score: 3, Informative

    The Python manual, embedded in the official distribution contains a very nice tutorial.

  19. Re:By Himself & Google by TaoPhoenix · · Score: 4, Interesting

    Interesting approach, but there is also a theme that some learners need a guide so that the 5 stunning ideas they never thought of don't become warps to their understanding.

    You said "don't spend money" - some of the new languages have free mini intro books. We can decide later in Language Wars about Python vs Ruby but for example Why The Lucky Stiff's Poignant Guide To Ruby looks stunning to capture the attention of an 11 year old with humor. That kind of thing is sorely lacking in most texts that feel they have to impress other academics. I have the programming aptitude of a gnat but I'll glance over that just because the sidebars are fun. From what I gather the programming content is well done, and a couple people have praised some of the language design mechanics of Ruby.

    --
    My first Journal Entry ever, in 8 years! http://slashdot.org/journal/365947/aphelion-scifi-fantasy-horror-poetry-webzine