Book contents
- Frontmatter
- Contents
- Preface
- Part I Background
- Part II Applications, tools, and tasks
- Interlude — Good practices for scientific computing
- Chapter 17 Research record-keeping
- Chapter 18 Data provenance
- Chapter 19 Reproducible and reliable code
- Chapter 20 Helpful tools
- Part III Fundamentals
- Conclusion
- Bibliography
- Index
Chapter 19 - Reproducible and reliable code
from Interlude — Good practices for scientific computing
Published online by Cambridge University Press: 06 June 2024
- Frontmatter
- Contents
- Preface
- Part I Background
- Part II Applications, tools, and tasks
- Interlude — Good practices for scientific computing
- Chapter 17 Research record-keeping
- Chapter 18 Data provenance
- Chapter 19 Reproducible and reliable code
- Chapter 20 Helpful tools
- Part III Fundamentals
- Conclusion
- Bibliography
- Index
Summary
Most scientists receive training in their domain of expertise but, with the possible exception of computer science, students of science receive little training in computer programming. While software engineering has brought forth sound principles for programming, training in software engineering only translates partially to scientific coding. Simply put, coding for science is not the same as coding for software. This chapter discusses best practices for writing correct, clear, and concise scientific code. We aim to ensure code is readable to others and supports data provenance, not hinders it. We also want the code to be a lasting recording of work performed, helping research reproducibility. Practices to address these concerns that we cover include clear variable names and code comments, favoring simple code, carefully documenting program dependencies and inputs, and using version control and logging. Together, these practices will enable your code to work better and more reliably for yourself and your collaborators.
Keywords
- Type
- Chapter
- Information
- Working with Network DataA Data Science Perspective, pp. 293 - 300Publisher: Cambridge University PressPrint publication year: 2024