This is another way pair programming can help. Besides having two heads thinking about the same problem, besides positive peer pressure to write tests and to follow the coding standards, there are two people learning about the code and learning from each other different ways to solve the same problem.

It does presume that both developers are reasonably competent. Now you might pair a guru with a newer programmer, but I'd expect that the newer programmer ought to be able to right decent code already.