Good practices in writing MATLAB code? [closed]
Solution 1:
Read Code Complete, it will do wonders for everything. It'll show you where, how, and when things matter. It's pretty much the Bible of software development (IMHO.)
Solution 2:
These are the most important two things to keep in mind when you are writing code:
- Don't write code that you've already written.
- Don't write code that you don't need to write.
Solution 3:
MATLAB Programming Style Guidelines by Richard Johnson is a good resource.
Solution 4:
Well, if you want it in layman's terms:
I reccomend people to write the shortest readable program that works.
There are a lot more rules about how to format code, name variables, design classes, separate responsibilities. But you should not forget that all of those rules are only there to make sure that your code is easy to check for errors, and to ensure it is maintainable by someone else than the original author. If keep the above reccomendation in mind, your progam will be just that.