Coding Best Practices - A Good Read
I have written blogs before on coding best practices in MATLAB and they have always generated a lot of great feedback. I recently came across a language-neutral list of best practices for scientific computing, written by Greg Wilson of Software Carpentry.
If you don't want to start by reading the whole article, I strongly encourage you to read Greg's summary. He breaks the practices into eight categories. I have to say, I think they are very well stated, starting with "Write programs for people, not computers.".
I have to say, I think Greg hit the nail on the head.
Do You Violate these Best Practices?
The most frequent violations I see include not using a debugger and, a lot of code is trying to optimize it before being sure it is truly correct. Which practice is your Achilles' heel? Let me know here.
Get the MATLAB code
Published with MATLAB® R2013b
Comments are closed.
7 CommentsOldest to Newest
MathWorks recently participated in a Software Carpentry workshop. Read more about it here:http://www.walkingrandomly.com/?p=5324
Is there a “Version Control System” within Matlab?
MATLAB does not have its own source code control system, but allows you to interface with existing ones. Check this link in the doc for more info: http://www.mathworks.com/help/matlab/source-control.html
I use and recommend Mercurial for MATLAB development. The MATLAB IDE doesn’t recognise it because it’s not “Microsoft Common Source Standard” but it works perfectly well with m-files, mat files and simulink files etc.
I have posted a number of messy TABLE class idioms. I would like MATLAB to be able to compete with Python Pandas or even R, but the TABLE class is awkward.
It would be great if you could have a thread, or even a separate blog (!) to address the elegant use of TABLE.
I have one article on tables here: http://blogs.mathworks.com/loren/2013/09/10/introduction-to-the-new-matlab-data-types-in-r2013b/
I did see that and it is well done, but I was hoping for some more advanced instruction. Many of my peers use Pandas and I need to be able to perform on that level.