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."

26 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 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...

    8. 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.
    9. 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
    10. 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"?
    11. 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. 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.

  4. 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?
  5. 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.
  6. Perl rocks! by swm · · Score: 5, Funny

    Learning Perl
    Schwartz & Christiansen

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

  7. 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!
  8. 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.

  9. 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
  10. 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
  11. 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