4

I am working as a PhD student developing scientific/engineering simulations and algorithms to be tested in these simulations. These days the first student started to work on my project (for his Bachelor thesis) and I am wondering: how should I organize the project now? I think I have some good C++ knowledge (although I still want to improve everyday!) and the code contains some design patterns, lots of templated classes etc. These techniques are new to the student and I wonder if it's a good idea to have him work directly in the trunk of the project.

Do you have any experiences what happens if programming newbies and more experienced programmers are mixed? Does the code get messed up or do the newbies learn more by this? Is it wise to have a branch for the student to test his algorithms and maybe merge them into the trunk later? Should I first give him a book like The Pragmatic Programmer for reading (better suggestions?)?

Thanks for every answer!

PLEASE NOTE: I asked this question on Stackoverflow. The answer was about code reviews and I think this is a good way, but I was also advised that this site might be the more correct one, so I wanted to see if there are more things that might help or other opinions?

2
  • See answers to this question for general guides- I don't think students are much different to other new developers in a lot of ways- either will probably be more clueless than you expect and need a lot of supervision at first: programmers.stackexchange.com/questions/8310/…
    – glenatron
    Oct 19, 2010 at 10:42
  • you're right. One difference I see is that students are often only working on my project for 3 months and I wonder how much time I should "invest" in them.
    – Philipp
    Oct 19, 2010 at 11:16

2 Answers 2

1

I'd suggest you create one or more branches for each student. Let them work with the code and mess it up, but don't merge it into the trunk until it is un-messed. If they can write more-or-less independent code, which is what your description sounds like, then to some extent you can just leave them to it and let them learn. If they need to modify core components then you'll need to be more hands-on with code reviews, testing and style requirements.

Once you know how good a coder the student is then you can think about giving them commit rights to the trunk.

It's difficult to apply industry principles (code review, style guidelines etc) to students because of the temporary nature of the work and the fact that research is the primary goal, not code writing. There is often some resistance to meeting industry standards because students often feel it is not worth their time writing unit tests and documentation: they've got a dissertation to write!

That said, whatever tools you can set up to encourage best practice will help. I recommend Git for version control because it makes branching and merging very easy, and you can set up a continuous integration server like Hudson or Cruise Control to help encourage cleaner coding - the dashboards will show things like test coverage, style violations etc if set up properly. I'm not too familiar with static analysis tools for C++, but in Java you can use things like Checkstyle and Findbugs to encourage good style. There must be similar tools for C++.

1

I agree with the code review and branching advise already given. I would also have them participate in design reviews. Have them peer review your design and you peer review their design. That way they learn and hopefully implement better code and design and sometimes newbies point out things that you missed just because they don't assume as much as experienced people.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.