I'm entering my 3rd year of my PhD program, and up until now my research code (numerical inverse problems/medical imaging/image processing/etc) consists mostly of disorganized MATLAB scripts and functions, with a few MEX'd C++ and CUDA routines thrown in for some added speed here and there.  Working with MATLAB has been (mostly) enjoyable, and I probably won't give it up completely, however:This summer, I've been working on a 'big' code at a national lab, and I'm starting to see the beauty in a well oiled, object oriented, version controlled code with a good use of gmake and other computer science toys.My question is this: to what extent should I try to incorporate these tools into my research code?  How much time should I spend planning the structure and implementation of my code, or should I stop thinking about it and just write good routines?  I feel as though I should be developing a well planned open source code base as a product of my dissertation, for the experience and CV cred, but I'm not sure how to navigate this process.  Any tips, book/article/website recommendations, etc?
How to plan & incorporate project management tools into research code
open source