Writing Clean Scientific Software
Description
This presentation discusses strategies for writing clean scientific software. Choosing meaningful variable names improves readability. Functions should be short, do exactly one thing, and have no side effects. High-level big picture code should be separated from low-level implementation details, for example by writing code as a top-down narrative. Because comments often become out-of-date as code evolves, it is preferable to refactor code to improve readability rather than describe how it works. Well-written tests increase the flexibility of code. This presentation encourages us to think of code as communication.
Notes
Files
WritingCleanScientificSoftware.pdf
Files
(643.1 kB)
Name | Size | Download all |
---|---|---|
md5:4229bff05d7e36bd63e489bf891affa8
|
643.1 kB | Preview Download |
Additional details
Related works
- Has part
- 10.5281/zenodo.3491142 (DOI)
References
- Albert, K.; Bouquin, D.; Farber, A.; and Hoover, R. (2019). Copyright Guide for Scientific Software. Zenodo. http://doi.org/10.5281/zenodo.3581326
- Feathers, M. (2004). Working Effectively with Legacy Code.
- Fowler, M. (2011). Eradicating Non-Determinism in Tests. https://martinfowler.com/articles/nonDeterminism.html
- Gamma, E.; Helm, R.; Johnson, R.; and Vlissides, J. (1995). Design Patterns: Elements of Reusable Object-Oriented Software.
- Hicks, S. Code Is Communication. https://steven-j-hicks-speaking.netlify.app/code-is-communication/#1
- Martin, R. C. (2009). Clean Code: A Handbook of Agile Software Craftsmanship.
- Martin, R. C. (2018). Clean Architecture: A Craftsman's Guide to Software Structure and Design.
- McConnell, S. (2004). Code Complete: A practical handbook of software construction, 2nd edition.
- Wilson, G.; Aruliah, D. A.; Brown C. T.; Chue Hong, N. P.; Davis, M.; Guy, R. T. et al. (2014). Best Practices for Scientific Computing, PLoS Biology, 12, e1001745, https://doi.org/10.1371/journal.pbio.1001745
- Wilson, G.; Bryan, J.; Cranston, K.; Kitzes, J.; Nederbragt, L.; Teal, T. K. (2017). Good enough practices in scientific computing. PLoS Computational Biology, 13, e1005510, https://doi.org/10.1371/journal.pcbi.1005510