[Use Version Control] |
Use version control and follow guidance on coding in the open. |
Use standard tools (Git & GitHub) to help you version control code. |
With your team, agree and design a version control workflow. Use (Git & GitHub) collaboratively and effectively. |
[Write Easy to Read Code] |
Follow the DHSC adopted style for your language, use meaningful names and avoid overlaps. |
Use a linter or code formatter to ensure that your code conforms to the style guide. |
Review your code with colleagues to make ensure your names and style promote understanding. |
[Correct, Clear, Fast & Concise - In That Order] |
Ensure that your code is correct and that it is clear how it functions. |
Make your code fast and concise, where possible without sacrificing correctness, clarity or excessive resource! Record choices made to achieve this balance. |
Use profiling tools to understand resource usage and refactor to improve clarity and performance. |
[Write Flexible Code] |
Break up your code into chunks, with a clear structure and don't repeat yourself. |
Think about, and document the way your code might break with different inputs. Include input validation to catch mistakes earlier in your code and make it easier to repurpose. |
Implement and test thorough error handling. Consider writing and sharing general purposes 'tool' code, especially if you solve a problem someone else might have. |
[Comment Effectively] |
Write and maintain accurate comments as you code. |
Think carefully about why you are leaving comments, what to capture, and what belongs elsewhere (in documentation). |
Review old code you have written - are the comments helpful? What would you include next time? |
[Document Your Work] |
Produce documentation in line with Aqua book guidance. |
Assemble documentation as you code. |
Use document generation tools to produce documentation. |
[Be Demonstrably Correct] |
Hold your code to the same standard as any other analysis and record evidence demonstrating it produces the right output. |
Use version control to unambiguously link QA to code and outputs and construct automated tests to provide confidence that changes don't break things. |
Make a fully automated reproducible analytical pipeline (RAP) which incorporates checks and validation and minimises opportunity for human error. |
[Use Sensible Defaults] |
Be aware of the defaults, understand why we have them and follow them unless you can explain how the benefits of an alternative approach outweigh those of consistency. |
Help define what the defaults should be, and actively participate in discussion and debate to keep them up to date and relevant. |
Proactively review and compare the defaults used with the way you work. |
[Be Reproducible] |
Keep track of what you have done and document it unambiguously so that someone else can recreate it. |
Write portable code, in a standard project structure so that it is easy for someone else to run it. |
Turn your code into a package / library / module, learn and promote RAP techniques, or use containers to achieve reproducibility. |
[Use Appropriate and Tidy Data] |
Know what 'Tidy Data' is, and understand why it is valuable. |
Be familiar with the data types and structures available to you and ensure that you use the right ones. |
Think about relationships between datasets, design schemas and store data in an efficient way. |