Software Practices

Last updated on 2026-10-07 | Edit this page

Here is the summary from the paper Best Practices for Scientific Computing with the relevant tools that we use below each item.

Write programs for people, not computers. - A program should not require its readers to hold more than a handful of facts in memory at once. - Make names consistent, distinctive, and meaningful. - Make code style and formatting consistent.

yapf, mypy, and pylint

Let the computer do the work. - Make the computer repeat tasks. - Save recent commands in a file for re-use. - Use a build tool to automate workflows.

make, and sphinx

Make incremental changes. - Work in small steps with frequent feedback and course correction. - Use a version control system. - Put everything that has been created manually in version control.

git

Don’t repeat yourself (or others). - Every piece of data must have a single authoritative representation in the system. - Modularize code rather than copying and pasting. - Re-use code instead of rewriting it.

Plan for mistakes. - Add assertions to programs to check their operation. - Use an off-the-shelf unit testing library. - Turn bugs into test cases. - Use a symbolic debugger.

pytest, and pdb

Optimize software only after it works correctly. - Use a profiler to identify bottlenecks. - Write code in the highest-level language possible.

cProfile, Python, Cython, cython.parallel, OpenMP

Document design and purpose, not mechanics. - Document interfaces and reasons, not implementations. - Refactor code in preference to explaining how it works. - Embed the documentation for a piece of software in that software.

Sphinx, and sed for make

Collaborate. - Use pre-merge code reviews. - Use pair programming when bringing someone new up to speed and when tackling particularly tricky problems. - Use an issue tracking tool.

GitLab issues

The Challenge of Reproducibility is Recognized

Here is a list of papers (some suggested by Claude AI) that have suggestions for better reproducibility:

  1. G. Wilson et al. Best Practices for Scientific Computing in PLOS Biology 2014

  2. T.G. Kolda Taming the Chaos of Computational Experiments in SIAM NEWS 2025

  3. G.K. Sandve et al. Ten Simple Rules for Reproducible Computational Research in PLOS Computational Biology 2013

  4. G. Wilson et al. Good Enough Practices in Scientific Computing in PLOS Computational Biology 2017

  5. R.D. Peng Reproducible Research in Computational Science. Science 2011

  6. L.A. Barba Terminologies for Reproducible Research. 2018

  7. D.L. Donoho et al. Reproducible Research in Computational Harmonic Analysis. Computing in Science & Engineering 2009

  8. R.J. LeVeque, I.M. Mitchell, & V. Stodden, V. Reproducible Research for Scientific Computing: Tools and Strategies for Changing the Culture Computing in Science & Engineering 2012