MATLAB Programming Style Guide
Richard Johnson
Version 1.5, OCT. 2002
Copyright; DataTool
Translation: Genial @ USTC
"Language is like a crached to dance to one, while all the time we long to move the stars to pity." - Gustave Flaubert, In Madame Bovary
Introduction The recommendations about MATLAB code are often emphasized, such as suggestions about "do not use loop", this guide is different. This guide mainly considers the correctness, clarity and versatility of code (format). The purpose of this guide is to help write more likely to be correct, easy to understand, more shared and more maintained. As Brian Kernighan wrote: "Well-written programs are better than badly-written ones - they have fewer errors and are easier to debug and to modify - so it is importat to think about style from the beginning." (Good Procedures for writing specifications are better than bad writing specifications because they have fewer errors, easy to debug and modify, so it is important to consider style from the beginning). The recommendations of the MATLAB code preparations listed in this guide are recognized in the actual work of the software development group. This guide is similar to the same manual with C, C and Java, but is amended to the characteristics and history of MATLAB. The suggestion in the guide is based on a variety of other code language guidelines and individual experience. The guide is not a commandment, its purpose is to make the programmer to write a good code in the simplicity. Many organizations have reason to deviate from this purpose. "You Got to know 'em. Otherwise it's no fun." --Sonny crockett in Miami Vice Matlab is a registered trademark of MathWorks, in this guide, an abbreviation TMW refers to THE MATHWORKS. This work is dedicated to those who are committed to carefully improve progress.