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
    • Comments
    • Doxygen
    • Whitespace
  • Code
    • General
    • Waves
    • Constants
    • Macros
    • Functions
    • Avoid Memory Leaks
    • Bitwise vs. logical operators
    • Prefer named entities over unnamed ones
    • No code outside the event switch in GUI control procedures
    • Preventing Debugger Popup
    • Runtime Error / Abort Handling Conventions
  • 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
    • Dimension labels versus numerical indizes

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

Navigation

  • Procedures
  • Whitespace and Comments
  • Code
  • General hints
  • Anti Patterns
  • Performance tests

Quick search

(HEAD) 7b3de98

©2017 - present, All contributors. | Powered by Sphinx 8.0.2 & Alabaster 1.0.0