Skip to content

Instantly share code, notes, and snippets.

@codisfy
codisfy / Start
Created November 19, 2022 18:36
Ansible
Initiate gist
@codisfy
codisfy / summary.md
Created October 9, 2022 21:55 — forked from angelialau/summary.md
(Summary) The Art of Readable Code

A summary of The Art of Readable Code by Dustin Boswell and Trevor Foucher

  • Overall metric for readability: code should be written to minimise the time it would take someone else to fully understand it (able to modify the code and spot bugs) Ways to improve readability (ranked from easiest change to most time intensive)
  1. Naming of variables and functions:
    • Use specific, descriptive, succinct names that say the entity's value or purpose
    • Use concrete names instead of abstract names e.g. canListenOnPort > serverCanStart
    • Add important attributes e.g. units or state e.g. unsafeUrl, safeUrl > url
    • Can use shorter variable names for smaller scope