This is a living document. We want our users to get as much value as possible from our analysis. Because of that, we will be updating these pages with additional outputs and insights when possible. To make sure you always access the latest insights, we recommend linking to these pages rather than sharing this analysis any other way at this stage.

Coding frequency and tools

Coding frequency

We asked respondents “In your current role, how often do you write code to complete your work objectives?”.

Show chart Show table
Coding frequency Count
Never 23
Rarely 22
Sometimes 33
Regularly 51
All the time 33
a Sample size = 162


What people are using code for

We asked respondents what data operations they carry out in their work, and whether they use code to do them. Please note we did not ask how much of each data operation is done with code, or how often.

Show chart Show table
Data operation I do some or all of this by coding I do this without coding
Analysis 123 23
Data cleaning 109 10
Data linking 84 5
Data transfer 30 15
Data visualisation 80 43
Machine learning 28 0
Modelling 49 7
a Sample size = 162


Access to and knowledge of programming languages

Given a list of programming tools, we asked respondents to answer “Yes”, “No” or “Don’t know” for the following statements;

  • This tool is available to use for my work.
  • I know how to program with this tool to a level suitable for my work.

Access to tools does not necessarily refer to official policy. Some analysts may have access to tools others cannot access within the same organisation.

Please note that capability in programming languages is self-reported here and was not objectively defined or tested.


Access to coding tools

Show chart Show table
Programming language Yes Don't Know No
C++ / C# 3 104 55
Java / Scala 18 93 51
Javascript / Typescript 18 95 49
Matlab 8 95 59
Python 140 10 12
R 146 11 5
SAS 78 58 26
SPSS 68 52 42
SQL 83 54 25
Stata 38 77 47
VBA 44 83 35
a Sample size = 162


Knowledge of coding tools

Show chart Show table
Programming language Yes Don't Know No
C++ / C# 13 5 144
Java / Scala 7 5 150
Javascript / Typescript 13 5 144
Matlab 25 5 132
Python 93 4 65
R 99 5 58
SAS 45 4 113
SPSS 75 5 82
SQL 67 3 92
Stata 29 7 126
VBA 27 8 127
a Sample size = 162


Access and knowledge gaps

Using the data presented above we calculated the number of respondents with:

  • Access to tools they do not have the capability to use (access only),
  • Access to tools they are able to use (access and knowledge)
  • Or capability to use tools they cannot access at work (knowledge only)
Show chart Show table
Programming language Access only Access and knowledge Knowledge only
C++ / C# 1 2 11
Java / Scala 14 4 3
Javascript / Typescript 8 10 3
Matlab 6 2 23
Python 50 90 3
R 49 97 2
SAS 44 34 11
SPSS 31 37 38
SQL 33 50 17
Stata 25 13 16
VBA 22 22 5
a Sample size = 162

Coding capability


Change in coding ability during current role

This question was only asked of respondents with coding experience outside of their current role. This means analysts who first learned to code in their current role are not included in the data.

Show chart Show table
Ability Change Count
Significantly worse 9
Slightly worse 15
No change 22
Slightly better 33
Significantly better 42
a Sample size = 121


Where respondents first learned to code

Respondents with coding experience outside their current role were asked when they first learned to code. This output also includes analysts who code in their current role but reported no other coding experience.

These data only show where people first learned to code. They do not show all the settings in which they had learned to code, to what extent, or how long ago.

Show chart Show table
First coding experience Count
In current role 36
In education 63
In private sector employment 6
In public sector employment 22
Self-taught 23
Other 4
a Sample size = 154


Coding practices

We asked respondents who said they currently use code in their work how often they carry out various coding practices. For more information on the practices presented below, please read our guidance on Quality Assurance of Code for Analysis and Research.

General coding practices

Show chart Show table
Percent
Question I don't understand this question Never Rarely Sometimes Regularly All the time
I use open source software when programming 15.1 12.2 6.5 10.8 23.7 31.7
My team open sources its code 20.9 30.9 13.7 18.0 10.1 6.5
I use a source code version control system e.g. Git 10.8 21.6 15.1 13.7 13.7 25.2
Code my team writes is reviewed by a colleague 2.9 2.9 11.5 24.5 36.7 21.6
I write repetitive elements in my code as functions 3.6 10.1 10.8 23.0 29.5 23.0
I unit test my code 34.5 13.7 11.5 18.0 14.4 7.9
I collect my code and supporting material into packages 10.8 43.9 13.7 15.8 7.2 8.6
I follow a standard directory structure when programming 25.2 11.5 11.5 22.3 18.7 10.8
I follow coding guidelines or style guides when programming 6.5 10.1 6.5 25.2 38.1 13.7
I write code to automatically quality assure data 7.9 22.3 17.3 25.2 18.0 9.4
My team applies the principles set out in the Aqua book when carrying out analysis as code 49.6 11.5 7.2 15.8 12.2 3.6
a Sample size = 139


Documentation

Embedded documentation is one of the components which make up a RAP minimum viable product. Documentation is important to help others be clear on how to use the product and what the code is intended to do.

Show chart Show table
Percent
Question I don't understand this question Never Rarely Sometimes Regularly All the time
Code comments 5.8 2.2 2.9 12.2 26.6 50.4
Documentation for each function or class 12.9 18.7 12.2 23.7 19.4 12.9
README files 10.8 29.5 13.7 16.5 15.8 13.7
Desk notes 17.3 14.4 7.2 23.7 25.9 11.5
Analytical Quality Assurance (AQA) logs 33.8 34.5 12.9 12.9 3.6 2.2
Data or assumptions registers 29.5 43.9 6.5 8.6 7.9 3.6
Flow charts 8.6 43.2 11.5 20.1 11.5 5.0
a Sample size = 139


Dependency management

Respondents who currently use code in their work were asked whether they use any tools for dependency management. We provided examples of tools that may be used for dependency management:

  • Requirements files, e.g. python requirements.txt or R DESCRIPTION files
  • Virtual environments (e.g. venv or renv) or virtual machines
  • Containers e.g. Docker
Show chart Show table
Use dependency management software Count
Yes 20
No 56
I don't know what dependency management is 63
a Sample size = 139


Reproducible workflow packages

Respondents were asked whether they use continuous integration technologies. As above, respondents were provided with examples of what those might be:

  • GitHub actions
  • Jenkins
  • Travis
Show chart Show table
Use reproducible workflow packages Count
Yes 6
No 77
I don't know what reproducible workflows are 56
a Sample size = 139


RAP knowledge and opinions

We asked respondents about their knowledge of and opinions on reproducible analytical pipelines (RAP). RAP refers to the use of practices from software engineering to make analysis more reproducible. These practices build on the advantages of writing analysis as code by ensuring increased quality, trust, efficiency, business continuity and knowledge management. The RAP champions are a network of analysts across government who promote and support RAP development in their departments.


Knowledge of RAP

We asked our respondents whether they had heard of RAP and what their knowledge is of their own department RAP champion.

Show chart Show table
RAP champion knowledge Count
Have not heard of RAP 48
Heard of RAP, have not heard of RAP champions 28
Heard of RAP, does not know department champion 64
Heard of RAP champions, no champion in department 1
Knows department RAP champion 16
a Sample size = 162


Show chart Show table
Line manage anyone who writes codes count
Yes 69
No 42
I don't line manage anyone 51
a Sample size = 162


Opinions on RAP

We asked respondents who had heard of RAP whether they agreed with a series of statements.

Show chart Show table
Percent
Question Strongly disagree Disagree Neutral Agree Strongly agree
I feel confident implementing RAP in my work 12.3 17.5 27.2 29.8 13.2
I feel supported to implement RAP in my work 9.6 17.5 28.1 32.5 12.3
I know where to find resources to help me implement RAP 5.3 23.7 22.8 34.2 14.0
I understand what the key components of the RAP methodology are 6.1 17.5 21.9 41.2 13.2
I think it is important to implement RAP in my work 1.8 4.4 21.9 41.2 30.7
I and/or my team are currently implementing RAP 10.5 17.5 27.2 27.2 17.5
I or my team are planning on implementing RAP in the next 12 months 7.9 14.9 31.6 27.2 18.4
a Sample size = 114


RAP scores

RAP component scores “regularly” or “all the time” to the relevant questions. For documentation, this includes both code comments and README files. For the continuous integration and dependency management components we only collected “yes”, “no” or “I don’t understand the question” responses. As such, we gave “yes” responses a score of 1. The sum total of each respondent’s scores is presented here as “RAP scores”.

A score of one for each RAP component is derived where respondents answered “regularly” or “all the time” to the relevant questions. For documentation, this includes both code comments and README files. For the continuous integration and dependency management components we only collected “yes”, “no” or “I don’t understand the question” responses. As such, we gave “yes” responses a score of 1. The sum total of each respondent’s scores is presented here as “RAP scores”. “Basic components” are the components which make up the RAP MVP. “Advanced components” are components that help improve reproducibility, but were are considered part of the minimum standard.


RAP components

Show chart Show table
Component Type Count
AQUA book guidance Basic 22
Documentation Basic 37
Peer review Basic 81
Team open source code Basic 23
Use open source software Basic 77
Version control Basic 54
Code packages Advanced 22
Continuous integration Advanced 30
Dependency management Advanced 20
Follow code style guidelines Advanced 72
Function documentation Advanced 45
Functions Advanced 73
Unit testing Advanced 31
a Sample size = 139


Basic RAP scores

Show chart Show table
Basic RAP score Count
0 20
1 34
2 39
3 15
4 21
5 7
6 3
a Sample size = 139


Advanced RAP scores

Show chart Show table
Advanced RAP score Count
0 36
1 27
2 29
3 16
4 15
5 3
6 6
7 7
a Sample size = 139