What is Open Code?

Contemporary research is increasingly supported by digital tools, with countless studies relying on code and computational methods to inform scientific discovery.

This extends beyond computational-focused disciplines, such as computer science or data science. Researchers in medicine, social sciences, humanities, and most other fields routinely use computer code to manage, analyse, and visualise their data.

As a result of its immense importance across disciplines, code has become an essential research output. Therefore, ensuring it is openly accessible and available for reuse is an important step towards satisfying the broader goals of open science.

In this article, we explore what open code is and why it has become an essential aspect of open science.

What is open code?

In its simplest definition, code is a series of instructions which tells a computer what to do and how to do it.

Code may include various components such as algorithms, formulas, computational workflows, or statistical analysis. Given this, code is frequently an important tool for supporting analysis, running simulations, and generating figures featured within a publication.

Open code, as part of the wider umbrella of open science, refers to the process of making code easily available online for others to view and inspect.

In the context of academic publishing, the term ‘open code’ is broadly used to denote the increased accessibility and visibility of research code. However, from a technical standpoint, it says little in relation to how code can be used by others.

This brings in two other important terms: open-source code and open-source software.

What does open source mean?

If something is ‘open source’, it can be viewed and also be redistributed or modified by others. For code to be open source, it must be shared alongside an open source licence.

An open source licence is important because it outlines the specific legal permissions for reuse, potentially granting others the ability to modify or redistribute the original code, depending on the respective licence attached.

Therefore, open-source code is code which grants others the legal right to make changes and reuse.

In addition, open source licences can also be attributed to entire software packages built from code. This is known as open-source software.

Therefore, while all open-source code and open-source software can be understood as examples of open code practices, not all research code which is ‘open’ can be used equally.

For scholars looking to maximise the impact and reproducibility of their code, attaching an open source licence is an important step for determining how others can use your work.

Key considerations when making your research code open

Organizing and cleaning your code is the first step in sharing it with the scholarly community. You want your code to be as useful as possible, so this should be an important consideration prior to sharing it with others.

Then, to maximise the usability and reproducibility of your code, researchers can utilise version control systems to track the changes which are made to code over time. The most widely used platforms for this include GitHub, GitLab, and Bitbucket.

Further, archival repositories such as Zenodo, Code Ocean, FigShare and also institutional repositories can then be used to assign Digital Object Identifiers (DOIs) to research code. This increases its discoverability by making it a citable research output which can be referenced in further scholarly publications.

Remember, without an open source licence, code can be viewed but not explicitly reused or modified. There are many different open source licences, which uniquely dictate how your work can be shared. Therefore, it is important to choose one which aligns with your research goals.

Resources such as choosealiscence.com, are available to guide scholars in selecting the most appropriate open source licence.

Providing additional documentation, often referred to as a README file, is another central aspect of making your code open. A README should provide an account of what the code is used for, along with instructions of how others can use the code.

The benefits of open code

Making research code publicly available has many benefits for the academic community. Such benefits include improving the transparency, reproducibility, and impact of scientific research.

Transparency

Maintaining transparency is an essential requirement for achieving the goals of open science and supporting the integrity of the scholarly record.

Open code aids transparency by providing a detailed overview of the specific processes and analytical decisions which have supported the research’s conclusion.

In thoroughly outlining the entire research process, open code works to build trust in both the research results and how they were achieved.

Reproducibility

In many ways, transparency feeds directly into reproducibility. Transparency fosters trust in the research process, an important consideration for researchers looking to reproduce an existing study.

All research should be reproducible, especially if published in a peer reviewed journal. Using open science practices such as open code increases reproducibility, making it easier for others to use it as a foundation for their own work.

In order to ensure that research can be replicated, and that its findings can be independently verified, other scholars must be able to easily identify and trace the exact steps taken to achieve a study’s conclusion.

For publications where original code forms a substantial part of the research results, making your code open holds huge implications for securing a study’s reproducibility.

This can be seen in instances where code sharing is mandatory: reproducibility rates rise by nearly 40% compared to studies relying solely on data sharing.

Impact

Transparency builds trust in a study’s processes and reproducibility provides the practical tools to use it as a platform for further discovery. In the case of open code, these two principles work together to encourage a greater impact.

The central idea behind open code is that it can be accessed, reused, and built upon by others. This greater visibility within the research community can help increase its reach and influence other research outputs.

Further, with open code making code a citable research output, the impact of your work can be measured by its inclusion in the proceeding literature.

Analysis of open science practices in France found that articles linked to shared source code receive, on average, 13.5% more citations than similar articles which do not share code.

Why is open code important?

Open code supports the broader goals of open science by making research more transparent, reproducible, and reusable. Access to the research code allows other researchers to inspect analytical methods, verify findings, and build upon existing work.

Given the extensive benefits of sharing your research code, it is unsurprising that open code practices are featured across landmark initiatives relating to open science.

The UNESCO Recommendation on Open Science identifies software and source code, amongst other research outputs, as crucial sources of scientific knowledge which should be made accessible for the academic community.

Directly tying into UNESCO’s advocacy of equitable access to information, openly shared code works to remove the barriers which prevent researchers using existing computational methods to inform and improve their work.

Additionally, the Horizon Europe programme mandates that researchers should ensure that code and software are made accessible under the principle of being “as open as possible, as closed as necessary”.

Therefore, for these organisations and bodies, sharing code is not simply an add-on to publication, but a necessary step within achieving open scientific communication.

MDPI’s commitment to advancing open science

MDPI continues to lead the global transition towards Open Access and understands the value of reproducibility and transparency.

Accordingly, MDPI encourages all its authors to publish their findings in as much detail as possible. On each journal webpage, MDPI provides instructions for authors to help authors prepare their manuscripts.

In the case of journals such as Data, MDPI reminds authors that their code should be deposited in a trusted, public repository or uploaded as supplementary information to the publication.

We’re dedicated to giving you all the information you need to understand Open Access. Our article All You Need to Know About Open Access covers a range of topics.