Introduction
In the modern life sciences, software has become as indispensable as the microscope. However, a significant gap exists between the necessity of computation and the formal training provided to researchers. Most scientists are self-taught coders, a reality that often leads to "spaghetti code," inadequate documentation, and a tendency to "reinvent the wheel." These habits do more than just hinder individual productivity; they pose a threat to the integrity of scientific discourse. Undocumented, unvetted code has been linked to high-profile retractions, and the lack of reproducibility remains a major hurdle in multidisciplinary research. This article provides a pragmatic, jargon-free roadmap to bridge the gap between ad-hoc hacking and professional software engineering, offering ten essential habits tailored for researchers.
Methodology
The guidelines presented here are synthesized from the collective experience of the "2020 Science" project, a multidisciplinary initiative funded by the EPSRC and Microsoft Research. By distilling years of firsthand experience in computational biology and physics, the authors have identified ten chronological rules that span the lifecycle of a research project—from initial planning and prototyping to final data sharing and community engagement.
Core Principles for Effective Research
The transition from a novice coder to an effective computational researcher involves more than just learning a new language; it requires a shift in mindset. The following rules provide actionable strategies for this transition.
Planning and Prototyping
Before writing a single line of code, researchers should "look before they leap" (Rule 1). A software literature review can prevent the redundant effort of building tools that already exist. When development is necessary, the "Rule of Three" for automation suggests that one should not automate a task until it has been performed manually three times, balancing the time investment of scripting against manual labor.
Prototyping should be treated as a first-class citizen (Rule 2). Utilizing high-level languages like Python, R, or Matlab allows for rapid iteration and clarification of logic. Moving to lower-level, optimized languages like C++ should only occur if performance requirements demand it, and only after the logic is sound.
Code Quality and Documentation
Effective research requires code that is understandable not just to the machine, but to humans—including the "future self" of the researcher (Rule 3). Meaningful variable names and modular functions are essential. Documentation is often viewed as a chore, but it is better framed as a survival strategy. While code explains how a process works, comments explain why specific decisions were made. Without this context, logic can become indecipherable within months.
Furthermore, researchers must maintain a digital or paper logbook to track the complexity of their commands and notes (Rule 4). Understanding the underpinning methods (Rule 5), such as the assumptions and stability limits of numerical solvers, is crucial to ensure the scientific validity of the output.
Verification and Visualization
Visualization should be integrated early in the process (Rule 6). Pictures are essential for debugging and identifying anomalies that might be missed in raw data. To manage the evolution of a project, version control systems like Git or Subversion are indispensable (Rule 7), allowing researchers to track changes and collaborate without fear of losing work.
Testing is another pillar of robust research (Rule 8). Automated testing frameworks should be used to verify that code behaves as expected, particularly for "corner cases" that might otherwise lead to silent failures.
Sharing and Community
One of the most significant psychological barriers in computational research is the fear of sharing code (Rule 9). Researchers often worry that others will find mistakes. However, the authors argue that if a researcher is concerned about errors, that is the strongest possible argument for sharing. Open-sourcing code and data facilitates peer review, encourages replication, and deters fraud.
Conclusion
Becoming technically effective is a daunting prospect amidst the pressures of academia, such as grant writing and teaching. The authors advocate for an incremental approach: "one rule per project" (Rule 10). By prioritizing progress over perfection and teaching these skills to others, the scientific community can move toward a future where code sharing is a standard prerequisite for publication. The future of computational science depends on this shift toward transparency and professionalized practice.
Summary updated