ÖгöÓ°Ôº

Supporting open science practices: Why sharing your code matters

T
The Source
By: Erika Pastrana, Thu Jul 17 2025
Erika Pastrana

Author: Erika Pastrana

Vice President, Nature Research Journals Portfolio

Research data and code are central to scientific discovery. Sharing these outputs can accelerate research, creating opportunities for the scientific community to make new insights and discoveries faster. In this blog, we¡¯ll explore why sharing your code benefits you and others, how we support you in making your code available, and the steps you can take.

What exactly do we mean by code sharing?

Research data and code are key elements of science. It¡¯s an inherent principle that researchers should be able to replicate and build on an authors¡¯ published claims (including their own work). Where code or mathematical algorithms have been a central part of the results described in a research article, it¡¯s important to make these available in trusted repositories, such as Code Ocean or Zenodo, that assign a permanent identifier. It should also be cited in your reference list, helping both reviewers and other researchers to assess, replicate, and build on those studies.

This practice isn¡¯t just integral to scientific, technical or medical research: quantitative research in the Social Sciences increasingly relies on new datasets and code. Additionally, it's not only essential for research published in journals: primary research described in books or chapters, where code has been used to generate results or support claims, is also important to share.

Other benefits of code sharing:

  1. Reproducibility: Being able to reproduce research not only improves trust but ultimately improves the collective knowledge base.
  2. Interdisciplinary application: Collaboration across disciplines through code sharing can enable new breakthroughs by reducing effort and duplication and enabling novel applications.
  3. Policy compliance: Code and data sharing are increasingly required by funders and institutions.

Our policy for code sharing

Our State of Open Data report and  continue to show that researchers need more support with code and data sharing. Our open science policies are designed to make it easier for you to share outputs, including our unified policy for journals and books on code sharing. The policy encourages code to be as open as possible, recognising that in some cases, there may be reasons that the full code cannot be shared.

For journals:

  • All research manuscripts involving newly developed code require a code availability statement, even when code cannot be shared (for example, due to legal or ethical concerns).
  • We also encourage you to make your code publicly accessible using a platform with a permanent identifier, such as Zenodo or Code Ocean.
  • Some journals, including Nature Portfolio titles, require code to be available to reviewers during the peer review process. It's important to consult individual journal submission guidelines and reach out to your editor

For books:

  • We strongly encourage making any supporting code available in a public repository, such as those mentioned above, at the time of publication.

Simplifying code sharing

Sharing code has its challenges. Beyond any technical, legal and commercial restrictions, running complex software on a different machine requires substantial effort and, in many cases, may not be feasible. We¡¯ve developed  and a  to help authors compile and present code for peer review.

Additionally, our enables authors to share code as part of the manuscript submission process, allowing for a more seamless experience to code sharing for peer review and publication, and giving you additional technical support. Using this service not only increases transparency but also helps peer reviewers verify what they are reviewing. Editorial support?is also available, with editors on hand to assist you in understanding and navigating our code-sharing policy.

Learning from Nature Computational Science

For journals that offer code sharing, we can see that combining policy and technical support has been highly effective in helping researchers share their code. Nature Computational Science has had a 100% code sharing compliance since 2021 (when it launched). Code is required during peer review, and the journal also encourages public sharing in a repository on publication. Our integration of Code Ocean into the submission process, along with proactive and passionate support from our editors, has helped authors to navigate their open science needs. As a result, every single primary research article published in the journal since launch provides a code availability statement and all?share their code publicly, cite it, and have a permanent identifier.

A code article format: the reusability report

Nature Machine Intelligence also encourages re-use of existing code via the . The reusability report explores alternative uses of previously published code in the context of a new dataset or new scientific application.

Getting started

Code sharing is not only best practice but an opportunity to drive reproducibility, collaboration, and trust in science, ultimately benefiting both the scientific community and society at large. To effectively support code sharing, here are a few key principles to consider:

  1. Plan ahead: It¡¯s important to plan for code sharing early in your project by reviewing relevant requirements from journals, funders, and your institution.
  2. Select a public repository: When you¡¯re ready to share, deposit your code using a platform that assigns a permanent identifier to the code, such as Zenodo or Code Ocean and include an open-source licence, if possible. If code sharing isn¡¯t a possibility, ensure that the reason is summarised in your code availability statement.
  3. Provide documentation: Ensure your code has all the relevant documentation such as README files, installation instructions, dependencies, and usage examples.
  4. Verify and test your code: Ensure your code has been tested before sharing and consider sharing updated versions of your code via version-controlled platforms.

Find out more about our code policy.

- Don't miss the latest news and blogs, sign up to The Source Monthly Digest! -

Erika Pastrana

Author: Erika Pastrana

Vice President, Nature Research Journals Portfolio

Erika Pastrana is the Vice President of the Nature Research Journals, a distinguished collection of 40 scientific publications that span diverse fields¡ªfrom Nature Water and Nature Sustainability to Nature Medicine and Nature Genetics. Under her leadership since January 2025, these journals uphold the highest standards of scientific reproducibility, global impact, and a strong commitment to open science.

Erika began her editorial career in 2010 as an editor at Nature Methods, focusing on neuroscience. In 2014, she transitioned to Nature Communications as a Team Manager, and by 2017, she became Editorial Director of the Nature Research Journals division, overseeing editorial strategy for health and applied sciences.

She holds a degree in Biochemistry and Molecular Biology and a Ph.D. in Neuroscience from the Universidad Aut¨®noma de Madrid, where she researched axonal regeneration in animal models of nervous system injury. Erika continued her scientific work with four years of postdoctoral research at Columbia University in New York.

In recognition of her contributions to scientific communication, Erika received the 2024 Communication Award from the Spanish Geographical Society.