Code

As an analyst, reusing code can reduce duplication of effort and save time. Sharing code from analysis and data management processes promotes a collaborative approach and helps researchers return to their work more efficiently. Knowing how to write and recognise well-written, well-documented code is therefore an essential skill.

The pages in this section are designed to help you get started with writing good code in a trusted research environment (TRE). They highlight best practice and provide examples and instructional materials across different programming languages.

Principles of statistical code

Writing high-quality code can feel challenging. ADR UK supports the sharing and reuse of code by applying the FAIR principles, which promote the Findability, Accessibility, Interoperability and Reuse of data.

Recognised practice in coding

This short webinar offers practical tips for writing effective code. 

Beginners may also find the guide Principles – Quality assurance of code for analysis and research useful. This resource covers:

  • Code review practices
  • Testing methodologies (unit, system, and integration testing)
  • Documentation standards (code comments, docstrings, README files)

It is designed to help developers improve the quality and reliability of their code using established quality assurance practices.

Download slides

Choosing your software for coding

This presentation from the SAIL Databank outlines good coding practices, including:

  • Selecting an appropriate programming language
  • Formatting and style considerations
  • Efficient data manipulation
  • Validation and documentation
  • Version control tools
  • Concept libraries

Reproducibility

Reproducibility is central to robust analysis. Analysts should be able to achieve the same results when using the same data and methods.

The following resources provide guidance and support for developing reproducible research practices:

Coding with AI

This introductory presentation explores how AI tools can support data analysis, even for those with little or no programming experience.

Download slides