Petr's Programming Tips and Motivational Statements
- debugging
is part of the game
- clarity
of the programming goal
- visualize
what variables look like
- imagine what the result should look like; then display
it.
- good
coding practice makes debugging easier
- comment your code
- immediately
open/close for loops and if-then statements (and comment)
- naming
conventions, e.g. all caps for constants
- avoid
hard-coding of any constant
- constant
definitions at top of m-file
- code
with generalization in mind
- use
descriptive variable names
- recycle
code & learn by example
- in Matlab
use help, in Unix use man or apropos
- think
of sub-directories as intermediate stages of a data analysis process:
they are places to store intermediate results.
- it is
good to keep within-subject analyses in a directory tree organized
by subject.
- it is
good to keep group analyses organized by the type of analysis performed.
-