Obviously there are many sites out there on "teach yourself how to code" and books on "learn to code in 30 days." I have a little bit of a different take on the subject, and would love to get your opinion.<p>If you were teaching a 14 year old the most important thing to expose them to the world of programming, what would it be? Let's say you have 1-2 hours a week and a year to do it.
I have been teaching my 13-year old sister how to code over Skype, and built this tool to help: <a href="http://replpad.com" rel="nofollow">http://replpad.com</a><p>It's a collaborative code editor that will run the code in-browser, so we can write together and run the code all on the same screen. We've been working through simple problems and I've been teaching her how to solve her math homework programmatically.
You need something based on intrinsic motivation.<p>A lot of people saying "start with teaching problem solving and algorithmic thinking" and while I agree that this might be "the best" way to learn how to do programming from some angles it is probably not especially motivating apart from to people who are intrinsically interested in math/logic puzzle type things.<p>It probably works as an approach in a CS programme where you have the luxury of saying "do this or you don't get a degree" and where you are trying to weed out people who might not hack it in the long run. It may also be more time efficient in developing actual programming skill, but that is not necessarily the point here.<p>A good example is to look at minecraft modding tutorials on youtube. Based on the commentary it's clear that some of these people don't really understand Java and don't really know what they are doing and are mainly learning by copying others. However they are still getting the results that they want to some degree so they keep going.<p>At some point these people will inevitably hit against hurdles because of their approach. At this point they may either give up in favour of some other hobby or they will naturally gravitate towards reading the accumulated wisdom about debugging techniques, OO design etc.<p>I can see why the more formal approach is appealing to people who started as being self taught and are introspecting about their own development as a programmer.<p>There's certainly plenty of times where I think about older programs I had written and thought "if only I had read textbook X first, that would have been much easier/better".
I think an interesting way to talk about programming that may be quiet successful for people who are younger is to try and strip away the sytax of language, and instead focus on the semantics. It would allow a person to develop a deep understanding of core concepts such as different data structures and algorithms without being bogged down in the minutiae. Once I think there is a solid foundation in the general concepts I think it would be much easier to transition from language to language since they already understand the semantics of what they are trying to do and simply have to focus on the sytax to accomplish it.<p>Now this has the potential to lead to disintrest since they wouldn't have the ability to create something and receive the instant feedback of their hard work. But I do feel like it may be an easier way to lead them into it without throwing them into the deep end of language specific syntax which i would imaging feels pretty dense and impenetrable to a lot of people starting out.<p>As well it would be pretty easy to create word problems or games that would help them develop the general understanding. Something like the following problem:<p>There is a 100 story building and you have two identical eggs. You need to figure out the highest floor that you can drop one of these eggs from without it breaking. Once an egg has broken you can never use it again. How would you go about figuring this out using the fewest possible drops possible? What if the building was 1,000,000 floors tall?
The same way you'd teach anyone else, as there isn't any advanced Math or vocabulary necessary.<p>Does the teenager have a knack for it already? I could've been coding before I was 10 years old and it would have been no more difficult for me to learn.<p>Making it a (fun) game is a good idea. Or you could have them come up with something they've been wanting to do, then use the process of creating that solution to introduce them to the concepts behind programming, and to how to apply them. Just have them work out how they'd go about creating that thing they mention, then show them how they are essentially programming already, and that the language they are learning is just a different way of expressing what they are already saying.<p>If they become curious or interested, then they'll spend their own time fighting with the code, and that will allow it all to sink in in a way they'll understand.
I've been teaching my girls how to code for a while now (was even published in Hacker Monthly magazine for it). My experience has taught me that the only reason they will learn to code is:<p><pre><code> If they have something they want to build themselves.
</code></pre>
I battled with this idea for a while. Why can't they just build a website and be done with it? Turns out, building websites is boring if you don't want a website.<p>I tried all sorts of languages and tools. What has worked for me has been using the Arduino platform to build animatronic projects for Halloween (a pumpkin that yelled and flash LEDs), and Minecraft. With Minecraft you can create your own textures and game objects by using Java. Its really fun, and they can see the connection between code and results very quickly. Try it out.
I'm sorry but there is very little you can teach them about programming that will stick with 1-2 hours a week of effort. Assuming the kids aren't self-selected (unusually bright, inherent interest in programming), you are very limited in what details you can expect them to remember from week to week. You're better off giving them a few hands-on tasks that are graphical and mostly self contained. Building a simple 2D game in stages over the year can work. Building a world with rules like gravity and momentum, and then building a simple collision detector might be the highlight of the course.
The khan academy has some really really good intro to CS videos for free. It is primarily python and JavaScript along with basics of algorithms and data structures. Show the kids that they get badges for learning and can compete for more points. I couldn't recommend it enough<p>www.khanacademy.org/cs/tutorials/programming-basics
I would try teaching him/her to make a simple website first. That way they can see that with a little effort, you can make something really neat on the computer.<p>CoronaSDK is also a good choice. Then there's all those sites like codecademy which would be helpful as well.
Out of my previous experience teaching a kid,
I would say introduce him to algorithms and problem solving techniques. Then, once he gets the good hold on it.
You can pick javascript for a good start.
And this is my opinion.
Codeacademy.com it is free and contains lessons on html,css,javascript,ruby,python,jquery, and apis. Plus if he really gets into it you can always sign him up for codeschool or team treehouse later.
I'd concentrate first on building internally consistent mental models.<p>A Lisp repl, I think, would be a fantastic tool for this -- and I suspect "Common Lisp, An Interactive Approach" might be the perfect text for homework.