A little background: I am one of two programmers for our department of 10 people (the rest are artists and management). The two of us do all of the coding required to make things flow well, and develop any projects that come up. I've been programming for about 4 years now, where this is his first real job (as he puts it). We generally are working on different projects at any point in time.A couple months ago I developed a (by no means perfect) set of classes that were to be used for a later project. A large portion of that project was delegated to him (for billing reasons) to design and program a GUI interface. Since he was new, I helped a bit with the designing, and said to ask for help if he needed it with the rest. He finished up the interface a few weeks ago, which he demo'd to show that it worked, although a little slow.The next part of that project has started which I'm working on. I opened up the interface to start with the next steps, and immediately ran into issues (a little slow was a little understatement, errors on common actions, etc.). I looked in to the code for a few issues and am finding O(n^n) on calls that should be O(n), type assumptions with no error checking (it's in Python), references to the GUI added to the original code, and so on.Now, I definitely would like to teach him what was wrong and how to fix it, but he's already moved on to his next project, and this was a few weeks ago. I'm afraid me saying Go back and do it right! (with help of course) is too harsh, and we still have other projects to get done in the meantime. Should I just fix the code myself for now and try to catch things in the future?
How should I go about fixing code from a less-experienced programmer?
code reviews;bug
Sounds like instituting some sort of code review policy might be beneficial on multiple levels. Some immediate benefits:You can directly influence the quality of his code before code is committed thus keeping the code base quality highKeeps you from making similar mistakes that another set of eyes may catchIn the absence of coding guidelines, reviews naturally lead to consistency in coding style Knowledge sharing. If there's only two of you and one gets hit by a bus...Now when you go ahead and start cleaning up his code, use that as a teaching exercise when you seek a review of this code. You will be getting your stuff reviewed, and he may learn how to do it better next time.