Ministry of Innovation / Business of Technology

Ask Stack: How to mentor a junior developer?

Ever found yourself working with a junior programmer and wishing he or she …


Josh Johnson asks: Recently, my company has hired a few new developers whose attitudes toward programming are different than my own. Some seek to extract just enough information to get a task done, but not enough to learn.

I've found myself going over and over the same issues with many of them, and I'm realizing it might be time to change the way I'm teaching.

How can I:

  • Give a junior programmer the tools to become more self-reliant?
  • Help a junior programmer break bad development habits early on?
  • Reduce the amount of time I spend mentoring these junior developers?

Top answer: 7 Tips (70 Votes)

Rachel replies: There was once a similar question around here, and one piece of advice stuck with me most: Don't touch their keyboard.


In addition to that, here are some other tips:

  • Encourage Google (or any other search tool). If you know the answer is easily found online, tell a junior developer to look it up instead of telling them the answer. Ultimately, you want to teach them how to teach themselves.
  • Make yourself available to answer questions. If you are ever not available or do not wish to be interrupted, make it clear to a junior developer that he or she should hold questions until a specified time.
  • Regularly hold code reviews. Use code reviews as an opportunity to point out best practices.
  • Begin early with best practices. It's easier to take the time to teach the right way early on than it is to change methods later.
  • Get started early with planning and documentating instead of letting junior developers jump right into code.
  • Be open to learning from a junior developer. They probably spend more time learning than you.
  • Help a junior developer learn from his or her mistakes. There will be mistakes. Be sure you show them that mistakes are part of improving.

Alternative answer: Put Yourself in their Shoes (15 Votes)


Essentially you want to encourage them to learn. Some people think that after college, they don't have to read books or learn anymore. This kind of attitude can lead to looking for shortcuts and "just getting it done."

Make sure junior developers have "The Pragmatic Programmer" and make sure they read it. This book will help them realize programming isn't just a job, it's a career and craft.

Recommend books to read every quarter or so. Help a junior developer build his/her "knowledge portfolio" (as defined in "The Pragmatic Programmer"). I highly recommend Safari Books Online which has a lot of CS/Programming books.

Once a junior developer builds a knowledge portfolio, he or she will know where to look when encountering future issues.

If you find some extra time at the office, pair programming can be very helpful. If you can't, use CodeCollaborator or a similar tool during code reviews.

Unit tests are very important as well. They can quickly reveal bad development practices, especially if you couple unit tests with continuous integration.

Answer: Ask & Listen (8 Votes)

HLGEM and JB King replies: Ask leading questions to steer a junior developer toward answers.

Ask what he or she would try next to complete a task. This can be helpful in determining what level of understanding the junior dev has on the problem. Is it: "I don't know what to do?" or "Well, I would try this, but..." Determining a junior dev's grasp can help determine the appropriate course of action.

Ask questions about a junior dev's background. He or she may know things that you have never had the chance to learn.

Always listen carefully. Not only will listening give you the information necessary to efficiently move a mentee's development forward, but listening fosters respect. You get respect by giving respect. And when a junior developer respects you, they will listen and learn and everyone's job will be made easier.


Expand full story

You must to comment.

You May Also Like