Skip to main content

Enabling Open Science through Research Code: Insights from Episode 4 - Documentation for Research Code

·756 words·4 mins
Author
RSSE Africa
Advancing research software engineering across Africa through community collaboration, knowledge sharing, and best practices.

Imagine youโ€™ve spent months crafting a complex research software tool, refining algorithms, and running countless simulations. It works brilliantlyโ€”but then, six months later, you revisit the code andโ€ฆ youโ€™re lost. Sounds familiar? Youโ€™re not alone. Experts shared their experiences and strategies for writing good documentation in the fourth episode of the Research Software Community Conversations Series titled Enabling Open Science through Research Code. Hereโ€™s what we learned from our participants and insightful panellists:

  • Jenny Wong - Product Manager @ 2i2c (UK/US)
  • Joel Nitta - Associate Professor @ Chiba University (Japan)
  • Mthetho Sovara - Centre for High-Performance Computing (CHPC), National Integrated Cyberinfrastructure System (NICIS) CSIR (South Africa)

๐Ÿ“Œ Why Documentation is Essential
#

๐Ÿš€ Boosts Reproducibility: Research software often accompanies papers, but results can be difficult to replicate without documentation. As Jenny pointed out, in fluid dynamics research, well-documented simulation codes gained more adoption than poorly documented alternatives.

๐Ÿค Facilitates Collaboration: Well-documented projects attract more contributors and streamline knowledge transfer. Joel shared his experience in the rOpenSci community, where clear documentation allowed him to take over and improve an existing R package without needing direct input from the original creator.

โณ Enhances Longevity: Code without documentation quickly becomes unusableโ€”even by its original authors! Mthetho described how well-documented software in weather forecasting led to unexpected collaborations with the South African Weather Service and Ethiopian researchers.

๐Ÿ”“ Promotes Open Science: Accessible research software fosters innovation and inclusion worldwide. Jenny emphasised that accessible documentation enables wider adoption of tools, making scientific computing more democratic.

๐Ÿ”ฅ Common Challenges & Solutions
#

โฐ Time Constraints โ†’ Write minimal but clear documentation as you code. Joel suggested that legible code, such as meaningful variable names instead of โ€œxโ€ or โ€œdatโ€, is itself a form of documentation that is even better than comments.

๐Ÿงฉ Lack of Standardisation โ†’ Use templates and structured frameworks. Mthetho mentioned that clear, structured guides helped non-computational scientists successfully use OpenFOAM in unexpected fields like environmental science.

๐ŸŽฏ Technical vs. User Documentation โ†’ Engage users in documentation efforts for clarity. Jenny highlighted the role of community-driven documentation efforts, such as hackathons, to improve usability.

๐Ÿ›  Best Practices for Better Documentation
#

โœ๏ธ 1. Write as You Code

Waiting until the end leads to missing details. Add inline comments and README files while developing. Joel emphasised that tools like RMarkdown (and its successor, Quarto) can be used for literate programmingโ€”thereby ensuring that the results of code are automatically generated alongside their description.

๐Ÿ”„ 2. Differentiate Documentation Types

โœ” User-facing documentation: How to install, use, and troubleshoot.

โœ” Developer-facing documentation: Comments, API references, contribution guides.

๐Ÿ“š 3. Use the Right Tools

๐Ÿ“„ Markdown & Jupyter Notebooks โ€“ Combine narrative and code.

๐Ÿ“ Quarto & R Markdown โ€“ For structured research outputs.

๐Ÿ“˜ Sphinx & MIST โ€“ Python-based documentation frameworks.

๐ŸŒ GitHub Wikis & Pages โ€“ Host documentation openly.

๐Ÿค– AI-based tools (e.g., Cursor, Copilot) โ€“ Assist with documentation (but always review!).

๐Ÿค 4. Community & Collaboration Matter

๐Ÿ’ก Participate in documentation hackathons. Jenny shared how Project Pythiaโ€™s hackathons provided a structured way to improve documentation in geospatial science.

๐ŸŒ Join communities like Project Pythia, The Carpentries, and Write the Docs.

๐Ÿ’ฐ 5. Advocate for Funding & Policy Support

๐Ÿ“ข Push for documentation funding in grant proposals.

๐Ÿ› Engage with funders to integrate documentation into open science policies.

๐Ÿš€ Future of Documentation: AI & Automation
#

๐Ÿค– Automated Documentation: AI tools generate initial drafts, saving researchers time. However, while helpful, AI-assisted documentation should always be reviewed for accuracy.

๐ŸŒ AI for Translation: Helps make documentation accessible in multiple languages, fostering global inclusivity. Anelda highlighted how AI tools might support research documentation in multilingual communities in the future. For now, we still need a human-in-the-loop translator for translation efforts. Especially for low-resourced languages.

โš ๏ธ Caution Needed: AI-generated content must be reviewed for accuracy and ethical considerations. Jenny raised concerns about biases in AI and the environmental impact of large-scale machine learning models.

๐ŸŽฏ Final Thoughts: Make Documentation a Priority
#

Great research code deserves great documentation. It makes work reproducible, fosters collaboration, and ensures that software remains usable long after its creator has moved on. By embracing best practices and community support, we can all contribute to a culture where documentation is seen not as a burdenโ€”but as a fundamental part of open science.

๐Ÿ“ข Explore More:

Access our Resource Sheet, which contains numerous valuable resources shared by the panellists, facilitators, and participants.

View the session recording on YouTube.

This meetup series is a collaboration between Talarify, RSSE Africa, RSE Asia, AREN, and ReSA.