mindful-programming

Computing resources for peace of mind

View the Project on GitHub crsl4/mindful-programming

Best computing practices

See Wilson, et al 2014

  1. Write programs for people, not computers
  2. Let the computer do the work (functions, scripts)
  3. Make incremental changes (use version control)
  4. Don’t repeat yourself (or others): no copy-paste!
  5. Plan for mistakes (add assersions to programs, code defensively)
  6. Optimize software only after it works correctly
  7. Document design and purpose, not mechanics
  8. Collaborate (github pull requests/issues)

Organization of projects

This section is inspired by Karl Broman’s notes.

Convention on naming files (very important for globbing to narrow file listing):

Write clear code

This section is inspired by Karl Broman’s notes.

Data Organization in spreadsheets

(Broman and Woo, 2017)

  1. Be consistent
    • Don’t use female/male and F/M in the same file
  2. Choose good names for things
    • No spaces in column names (or anywhere)
    • Avoid special characters
  3. Write dates as YYYY-MM-DD
  4. No empty cells
  5. Put just one thing in a cell
  6. Make it a rectangle
  7. Create a data dictionary
  8. No calculations in raw data files
  9. Don’t use font color or highlighting as data
    • The file should be machine-readable, not human readable
  10. Save data as text files