ResearchSkillsToolkit

Principles of Good Code Writing

A beginner-friendly guide for researchers to write clean, reproducible code.

Welcome!

This guide is for anyone writing code - even if you have zero formal programming training.

No prior experience required.

Simple, practical tips that apply to any language (Python, R, MATLAB, etc.).


Why This Guide Exists ๐Ÿ’ญ

Good code is like a well-organized lab notebook:


Table of Contents ๐Ÿ“–

  1. Introduction
  2. What Makes Code Good?
  3. Naming Things Well
  4. Writing Readable Code
  5. Commenting and Documenting
  6. Breaking Code Into Chunks
  7. Core Coding Principles (DRY, KISS, YAGNI)
  8. Avoiding Common Mistakes
  9. Write Code Like a Lab Notebook
  10. Reproducibility in Practice
  11. Magic Numbers & Checks
  12. Reading Error Messages
  13. Cheat Sheet
  14. Emergency Fixes

How to Use This Guide


Further Reading (Extra resources)


โ† Back to Research Skills Toolkit