How to get a 15-year-old started with coding?

7 points by scottdrake ↗ HN
I have a nephew who has expressed interest in spending part of his summer learning more about computers and learning to code a bit.

I was thinking about inviting him to spend a few weeks at my dev shop where he can work largely in isolation but I'll be around and a couple of my guys can give him some guidance and help him learn.

Basically, my question is if you were trying to introduce a 15-year-old to coding, how would you go about it?

I was thinking about sticking a few books in front of him and challenging him to build a basic twitter or flickr clone just to give him a target. Maybe 2 days on HTML/CSS, 2 days on JQuery, 3-5 days in PHP or Ruby but I want to keep him away from frameworks, maybe another week with MySQL or SQL and trying to put it all together. I can build him the DB if needed.

It's been 16 years since I started so it's hard to put myself in his shoes. For some of you younger coders:

1) When you started coding, what did you start with? HTML/CSS, then basic scripting or JQuery, then DB stuff? What language would you start with today if you were just starting?

2) What resources did you use? Web sites/tutorials? Books? Any good entry level books you'd recommend I put in front of him?

3) Did you have specific things you were trying to build?

4) Did anyone help you or provide guidance? If so how/what?

5) What kind of guidance would have helped you?

14 comments

[ 5.1 ms ] story [ 56.5 ms ] thread
I started recently learning with a pretty good book on Python. It teaches by having you create little games. "Python Programming for the Absolute Beginner, 3rd Edition" By Michael Dawson. For Ruby on Rails, a great, if a little wacky introduction, would be: http://mislav.uniqpath.com/poignant-guide/
1. I started coding in QBASIC, then VB, then VB.NET, then HTML/CSS/JavaScript, then Java, then Ruby, then Python, then C#. If I was starting today, I would use Ruby or Python.

2. Built-in documentation, college classes and web documentation. Generally I find documentation far more useful than tutorials. I would highly recommend checking out Zed Shaw's new book: Learn Python the Hard Way (http://learnpythonthehardway.org/index).

3. I don't think I've ever learned anything when I didn't have something specific to build. Just playing around trying to learn stuff never works for me. I need to have a reason to learn, a project that needs the technology I'm trying to learn.

4. I've had very little direct guidance in learning to program. I had my professors, which helped me mostly by introducing me to the technologies and giving me things to build. I've had various people on StackOverflow help me with particular. Mostly, I am guided by inspiration, not direction interaction. People like Zed Shaw inspire me. People like why. Sometimes libraries inspire me. LINQ is incredibly inspiring. As is pyparsing. These people and libraries give me an idea of what I want my contributions to the programming world to look like.

5. Best guidance in my mind is giving you a tool and then giving you something to build with it. I never would have found Ruby without one of my professors (or I would have found it a lot later). I may never have cared without Ruby Quiz and Rails inspiring me to build things. This is why I think you should check out Zed's python book. He teaches the language by giving you the tools and then asking you to do things with them.

great suggestion ... I'll forward him that PDF when he's done with finals and if he works his way through that and wants to learn more, I'll invite him to spend a few weeks at my shop. Thanks Daniel.
When you do, let me know how it's working out for him. I may start holding in-person meetups for people who try to go through the book and I watch and make notes on things that need to be improved. I'll announce it if I do.
In reality, web development is quite a hostile environment, in my opinion. Too many different technologies. Better to keep him 'sandboxed' in a single environment, say, Ruby. The great thing about web development of course, is that it's easy to see what you can achieve. Hacking Ruby command line scripts not so much. When I started back in the 90'es it was Visual Basic 6. As horrible a language it was, the instant gratification of pointing a button to a certain method etc. was invaluable, in my opinion.

Edit: O.K., I don't have any current ideas, sorry :)

I'd start with python or javascript these days (I personally did my first self taught hacking in basic on DOS -- some simple text processing for a statistics class). I think the learner resources might be better for python. If he doesn't know anything about programming then you might not be allowing enough time on the different technologies, that's pulling together a lot for a first project.

If you have a modern enough browser you might be able to keep it to html/css/javascript and use web storage for a database. That'd be good for some little single user system or browser based game or something.

Depending on the type of person he is and what you work on at your dev shop you could get him to fix real-but-small problems -- language in error messages, pixel level interface visual problems, etc.

yeah, that might be a bit aggressive with the number of technologies. He can probably get lost in HTML/css/javascript for a couple of months. I'd just like to give him an opportunity to build something he currently uses so he doesn't waste a bunch of time figuring out what to build. I'll have to dig into python and see if any of my guys around here know it. I don't and I'd like to keep him working in something that we use so we can help him out. Thanks for the comment.
Is there a FIRST Robotics or FIRST tech challenge team at his school or in his area? (http://usfirst.org/) Programming robots is a great way to pull in kids (for FRC, they can use C/C++, LabVIEW or Java, FTC is LabVIEW or C I think).

I'd avoid HTML/CSS/PHP like the plague for a newbie. Have him write an ELIZA-style chatbot in Python or do some Project Euler questions in Python/C++/C#/Java

I tried to get into programming several times before it finally stuck. I ended up with a collection of c++ and java books that I never got further than a few chapters in. JavaScript of all things really got me into programming. I stuck with it long enough because I received nearly instantaneous gratification. I could actually make things happen on screen. Manipulating strings and tossing numbers around in a terminal window gets boring fast and the bar to entry for GUIs in java or c++ is tedious and frustrating. Once I understood the basics of programming, it wasn't much for me to pick up python, java, ruby, AS3, etc.. So, you're bang on with starting him building a web app. For so many reasons really...

To answer your questions directly...

1. I'd start with JavaScript because it's fun and useful (despite its warts) and either python or ruby.

2. Stackoverflow.com, The Pragmatic Programmer

3. I had a client/server computer science course that was making me build very small apps but it wasn't until I had an idea for something I really wanted to build that I started staying up all night learning. Before I had either my own "itch to scratch" or a professor requiring me to building something I floundered and got bored quickly. I needed a clearly defined goal to accomplish.

4. Sadly, no. My professor wasn't really interested in his students. Google was my only friend.

5. For someone to sit down and clearly explain fundamental concepts to me like OOP, MVC, etc. It's one thing to read about it but someone over my shoulder pointing at things and explaining why a block of code sucks or not would have really helped.

Best of luck. If you nephew sticks with coding, he will really thank you later!

1) HTML/CSS -> PHP/MySQL -> Javascript -> Python

2) Random tutorials online and an O'Reilly PHP/MySQL book.

3) Yes, and that was critical. I basically learned what I needed to get the next thing done

4) A friend helped get me pointed in the right direction, and I took it from there.

5) General best-practices. I started with just notepad and had horrible coding style. I think just having someone to answer questions and occasionally review code would have been a tremendous help.

Although PHP pretty much sucks as a language, it was extremely gratifying to see my work progress quickly ("Look, I made that dynamic list out of values in a database!").

1) I started with BASIC/QBASIC, assembler, some C, html/css, javascript, php and then some python. Later at school I got C/C++, Java and VB.NET but by then I was already web development for quite some time. 2) At first I only had old books from my local library, hence the BASIC/QBASIC, assembler and C. Later they ordered new books on the 'new HTML 4.0' and soon I started doing js and php as well. 3) no not really, although I did have projects of my own most of it was purely for fun. To be honest, it only struck me after a year or so I was programming, before that I was only trying stuff out. I think that's an important part of the deal, having fun and just trying new things. 4) I was on my own, I didn't have anyone behind me to teach me... 5) To be honest I think should have focused more on C/C++, but I absolutely don't regret being a web developer, I would hate being a C/C++ developer I think. I don't know why, just a feeling...

About helping your nephew, try to make him see it as a game and have some fun. Explain that the computer does whatever he wants, he only has to program it himself. If the application, in whatever language it is written, doesn't run, you have a 99.9% change it's your own fault.

1) I started with HTML in '96 and, TI calculator programming aside, it wasn't until 2000 (college) that I got into programming. Mostly because I asked around and nobody knew where to tell me to start (Java -> Python -> Javascript). If I were starting today and on a *nix environment, I'd start with javascript. Doing simple socket programming with node.js is dead simple and the browser provides an obvious gui progression path. I've also heard of a lot of people starting with Python and very recently with Obj-C/iphone development.

2) Started with a teach-yourself HTML 3.2 book. For learning JS today, I think eloquentjavascript.net is good if a bit dry and I like Manning's jQuery in Action if going the jQuery route.

3) I started out with the intent of making a WYSIWYG web editor that didn't suck...and I'm still planning on doing it at "some point".

4) No guidance for me, unfortunately. Aside from having a professor in my first Java class say "well don't worry about that, you don't need to understand it for a while", which annoyed me enough that I went and learned Java myself through Thinking in Java. Otherwise I'm entirely self taught.

5) Guidance on what to look at/what to understand would have been helpful. I'm very grateful to the mozilla project, since that's where I learned software engineering. Having someone point out version control earlier on would have been helpful.

I'm younger myself, and I started learning with WYSIWYG html and copy+paste javascript. From there, I learned real html and css, progressing to PHP. After PHP, I was real interested in this thing called Ruby on Rails, took me forever to even get it installed. After that, I continued to work in rails and ruby, along with php. I think if I could do it again, I'd start learning just python or ruby. A linux environment is a big plus, even if it's just a virtual machine. Javascript is a great language, and starting out with jQuery then backtracing to real javascript is a good, and instantly gratifying way to learn, you have to start somewhere.