Do you think that its a good idea when a junior programmer needs help to always jump in and try to educate them? Or will they ignore all the "teaching to fish" advice you give them and just focus on the "fish" you just brought them? Do you let them always figure things out on their own, knowing that mistakes are the best way to learn? Or are you afraid that they'll get so burnt and frustrated that they'll lose the desire to come up to speed?

When do you choose when to help someone more junior then you and when to stand back and let them learn through their mistakes?

At one of my jobs, I was both learning and teaching(because I of course don't know everything, but I know more than some)

Do not at all costs lay your hands on the keyboard. This is frustrating both for you, and the person you are teaching. Even if you give them step by step instructions, when you put your hands on the keyboard it's the equivalent of giving them a piece of code and saying "this fixes it". 

In what I've learned: 


Don't type the code for them
Try to teach on their level(if they understand the syntax, don't explain it to them. This will just bore them; instead teach the classes/functions used)
Don't ignore them or say "figure it out on your own". What you'll end up with is them coming to you later except for now the 3 lines of code they had problems with, is now 50 lines spread across 8 files trying to work around the problem.
Teach them to learn on their own. One of the best ways is tell them to use stackoverflow. I sometimes, even knowing the answer, if they asked me. I'd say "well, I'm going to ask this question on stackoverflow". and I'd give them a link to the question. Take a coffee break and look at some different code. When they came back asking "so how do I fix that problem" just tell them to look up their question on SO(using the URL you gave them). I've found that the masses are usually a better teacher than I am.
When they copy and paste code from the internet and ask why it doesn't work, ask them to explain what each line does. If they can't, then tell them to research the functions/classes used. If needed, provide explanations for the class and functions
Conduct code reviews to make sure they are solving the problem, not just working around it for it to show up later.
Be nice. When someone is just starting out in your codebase with no documentation, don't just tell them to read the source code. Give a summarized high level overview of the function in question. Or, better yet, start writing documentation :)
Be humble. Don't BS about the problem. If you don't know it, say you don't and help them look it up. Many times, just knowing the domain enough to know what keywords to search for is enough help for you to give them.

