Clean Code

"Any fool can write code that a computer can understand. Good programmers write code that humans can understand" - Martin Fowler

Text

Contents

  • Philosophy
  • Naming
  • Functions
  • Control flow
  • Comments
  • Code is for humans
  • Writing/reading code
  • Bad code - technical debt
  • Code - programmers portfolio
  • Right tool for the job
  • Signal to noise ratio

Naming

  • English
  • Abbreviations
  • Objects
  • Booleans
  • Functions
  • Symmetry
  • Warning signs

Functions

  • Small
  • Do one thing
  • Arguments
  • No side effects
  • Mayfly variables
  • Command query separation
  • Pure functions

Control flow

  • Truthy/Falsey
  • Boolean assignments
  • Positive conditionals
  • Ternary operators
  • Magic numbers
  • Methods in if statements
  • Declarative when possible

Comments

  • Self-documented code
  • Redundant / duplication
  • Warnings/apologies
  • Zombie code
  • Dividers

deck

By Marius Jurgelenas