Possible Duplicate:
How to help a struggling newbie do a better job?
What is the best way you have found for helping a new or inexperienced programmers overcome common mistakes?
Possible Duplicate:
How to help a struggling newbie do a better job?
What is the best way you have found for helping a new or inexperienced programmers overcome common mistakes?
Pair Programming or mentoring has worked very well for me in the past.
Comment your existing code so they have a good reference.
Unit testing.
Convince them that they can do it. You should give them some work on the application you are currently working. And also give them some testing.
Let them make the common mistakes..and then show them why it's a mistake
Introduce them to Stack Overflow, but make sure they don't get into the habit of browsing it at work all the time. At the very least, it's been quite helpful in overcoming my own common mistakes ever since I discovered it.
I wholeheartedly agree with introducing them to Stack Overflow. As a still somewhat novice programmer myself, SO has helped immensely. Not just for asking questions and receiving answers, but just browsing the site and learning.
Though I have limited experience actually being the more knowledgeable person in situations like this, I've found it's really helpful to have someone explain exactly what their code says and what their logic behind it is before tackling the errors they're getting. It's fast and easy to find a syntax problem and fix it for them, but it seems like a lot more is learned when you have them explain what they want and why they did it this way. Once you know this, you can address any fundamental problems and help fix issues with the deeper understanding of programming logic, which is far more important than simple syntax errors.
And try to remember that some things can be hard to grasp for someone new to this way of thinking. Arrays (especially multidimensional ones), objects, nested loops, and methods (especially with variable passing) are all ideas that can be lost on newcomers at first. As people who have already passed that "tipping point" of thinking like a programmer, it's easy to forget that there was a time when 0 didn't make sense as the position of the first element in an array. Pushing someone along when they have a misunderstanding of important concepts, assuming they'll figure it out later, is a bad idea.