Igor Pro coding conventions and best practices¶
The following document defines a set of well-proven coding conventions and guide lines for all levels of Igorians.
- Procedures
- Whitespace and Comments
- Code
- General hints
- Anti Patterns
- if and do/while instead of for loops
- Inconsistent WAVE/DFREF/NVAR/SVAR usage
- Treating boolean variables as non-boolean
- Superfluous comparison for boolean values
- Unnecessary variables
- Wave/Datafolder creator functions don’t return the just created objects
- Unnecessary use of StringMatch
- Unnecessary loops
- Unnecessary use of sprintf
- Unnecessary use of Execute
- Avoid relying on the top window and prefer structure based GUI control procedures
- Avoid magic numbers
- Unused parameters
- Avoid function calls in loop statements
- Performance tests
Links and Literature¶
Git settings for Igor Pro code: http://www.igorexchange.com/node/6013
Robert C. Martin, Clean Code: A Handbook of Agile Software Craftsmanship, Prentice Hall (2008)
How to write good commit messages: http://who-t.blogspot.de/2009/12/on-commit-messages.html