Is there a difference between Pair Programming and Mentoring? Yes. Pair Programming is one of the XP practices. http://www.extremeprogramming.org/rules/pair.html says “One thing pair programming is not is mentoring. A teacher-student relationship feels very different from two people working together as equals even if one has significantly more experience”.
In project organizations, mentoring is crucial. Think about inducting graduate trainees or fresh graduates into software projects. In this situation, in addition to an induction program, identification of mentors and investing in mentoring programs provide lot of value. Also think about experienced new joiners. They may need some mentoring. When mentoring sessions include hands-on coding and discussions on ‘code quality’ and ‘design quality’ team members get an opportunity to learn to write good quality code.
Pair Programming is not practiced in all Agile projects. It is a common practice in all XP teams. In many projects Pair Programming remains in the wish list. Pairing requires rapport, trust and excellent work relationship. One way to start pair programming is to start pairing from an hour to couple of hours per day. This can provide positive results.
Mentoring takes a different approach. Identifying the need for mentoring on a case-to-case basis has to be one of the top considerations in software projects. Mentoring (when required) cannot be ignored or forgotten. Mentoring is not sufficient to produce good quality code. Practices such as pair programming help a lot.
Above all self-review of code cannot be ignored. Programmers can start self-reviews in simple ways. All they have to do is to ensure that they can eliminate a fixed list of programming errors (say 20 to 25 things) through self-reviews. This, in my opinion is the first step in the journey to improve code quality. With these steps, practices such as pair programming or peer-reviews will yield better results.
Mentoring is a great opportunity to imbibe the importance of self-reviews and self-review checklists in teams. Also, it is a great mechanism to bond new team members into teams.
Understanding the importance of mentoring and investing in mentoring programs comes first. When you do this you will know how to (also when to) introduce appropriate engineering practices in software project teams.