The ONS RAP standards at a glance

  1. Use open-source languages for coding

  2. Minimise repetition

    1. Use control flow
    2. Use functions
    3. Make complex code modular
  3. Make your code readable and self-documenting

    1. Use a standard code style
    2. Everything that has a name in your code should have a name that is easy to understand
    3. It should be easy to understand which packages you use and where functions come from
  4. Document everything that is needed to write and run the code

    1. Create README files for every project
    2. Embed design documentation with code
    3. Document dependencies
    4. Record manual quality assurance and tests
  5. Document what the code is doing

    1. Code comments should explain the “why”, not the “how”
    2. Document functions and classes
  6. Code modules should run end-to-end without manual intervention

    1. minimise manual steps
    2. Use configuration files
  7. Use git for version control

  8. Make sure your code meets quality standards

    1. Make sure your analysis meets quality standards
    2. Review all code as you go
    3. Test your code
  9. Maintain and improve re-usable code continuously

    1. Make code improvements before errors occur
    2. Develop your code iteratively
  10. Don’t reinvent the wheel

  11. Set out clear aims and scope for each project

  12. Set out your quality specifications

  13. If appropriate, plan to open source your code in the future

  14. Set out clear, well defined roles and responsibilities

  15. Make a succession plan