Hacker News new | ask | show | jobs
by aasarava 6541 days ago
I've done this a few times (C++, PHP, HTML, CSS, etc.) and it seems to work best when you treat it as if you're teaching someone to drive a car: Both of you are sitting side by side in front of the same computer, with the trainee driving.

First, I like to show the person some feature in the program or Web site, like say a popup window. Then I show them the code for that window. Then I show them how to modify different components by adjusting variables and so on, so that they get the feel for where all the moving parts are and see how their changes directly affect the popup window.

Then, I have them write a basic function that does the same thing, but this time from scratch. Once we go over what worked and didn't and debug the code and get things working, we move on to a second function or construct.

Ultimately, the goal is to start small and continue expanding from there, kind of like having the trainee drive around a parking lot, then city streets, then the freeway.

Most importantly, I find that the key is to keep building on the same code, and helping the trainee see their program grow into something useful -- as opposed to simply showing them one construct in the abstract and then another and then another, without tying them together in any way.