views:

144

answers:

10

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?

+6  A: 
  • Peer Code Reviews
  • Partner Programming
Noah Goodrich
I've never done pair programming, but the code reviews that I have done with young engineers have been valuable for them and me as well.
Adam Crossland
A: 

testing testing testing.

hvgotcodes
This advice applies just as equally to the most senior engineers as to the most junior ones.
Adam Crossland
A: 

Pair Programming or mentoring has worked very well for me in the past.

northpole
+1  A: 

Comment your existing code so they have a good reference.

Unit testing.

Jason
A: 

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.

Kapil
+2  A: 

Let them make the common mistakes..and then show them why it's a mistake

Ed B
+1  A: 

practice, practice, practice

JRam930
+2  A: 

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.

JAB
+1 for the guilt trip
rownage
Aww man, why did you have to do that?
Sean O'Hollaren
A: 

Buy a cattle prod.

Paddy
+2  A: 

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.

Sean O'Hollaren