Computational science, also known as scientific computing or scientific computation (SC), is a rapidly growing multidisciplinary field that uses advanced computing capabilities to understand and solve complex problems. It is an area of science which spans many disciplines, but at its core it involves the development of models and simulations to understand natural systems.
- Algorithms (numerical and non-numerical): mathematical models, computational models, and computer simulations developed to solve science (e.g., biological, physical, and social), engineering, and humanities problems
- Computer and information science that develops and optimizes the advanced system hardware, software, networking, and data management components needed to solve computationally demanding problems
- The computing infrastructure that supports both the science and engineering problem solving and the developmental computer and information science
The purpose of this resource is to describe best practices in the field of scientific computing. Computing has become an essential scientific tool in research, yet techniques in this discipline are often not taught.
Summary of Best Practices (reproduced from Wilson et al 2014)
- 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.
- 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 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.
- 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.
- Optimize software only after it works correctly.
- Use a profiler to identify bottlenecks.
- Write code in the highest-level language possible.
- 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.
- 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.
- Wilson, Greg; Bryan, Jennifer; Cranston, Karen; Kitzes, Justin; Nederbragt, Lex; Teal, Tracy K. (2017). "Good enough practices in scientific computing". Plos Computational Biology 13 (6): e1005510. doi:10.1371/journal.pcbi.1005510. PMID 28640806. PMC 5480810. //www.ncbi.nlm.nih.gov/pmc/articles/PMC5480810/. "Computers are now essential in all branches of science, but most researchers are never taught the equivalent of basic lab skills for research computing."
- Wilson, Greg; Aruliah, D. A.; Brown, C. Titus; Chue Hong, Neil P.; Davis, Matt; Guy, Richard T.; Haddock, Steven H. D.; Huff, Kathryn D. et al. (2014). "Best Practices for Scientific Computing". PLOS Biology 12 (1): e1001745. doi:10.1371/journal.pbio.1001745. PMID 24415924. PMC 3886731. //www.ncbi.nlm.nih.gov/pmc/articles/PMC3886731/. "This is an open-access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited."