Upgrade to Pro — share decks privately, control downloads, hide ads and more …

TL;DR: Reading Code Is Harder Than Writing It

Trisha Gee
September 11, 2019

TL;DR: Reading Code Is Harder Than Writing It

It's funny that computer languages are the only languages where one learns to write before learning to read. It's actually not uncommon for people to never really learn to read code. This seems a little unbalanced given that we actually read code much more frequently than we write it.

Even those who promote software as a craft sometimes fall into the trap of often talking about writing clean code that people can read, yet not placing much emphasis on the skill of reading the code.

The ability to read code must also be a skill, and as such it must be something that can be learnt and practiced. In this presentation, we're going to look at:

- The different reasons we might have to read code, and how that should impact our reading
- The problems we face when reading code (even our own!)
- Tips to bear in mind when we're reading code
- Tools we can use to help our understanding
- How and where to practice these skills

At the end of the talk we will at least have considered whether we need to level up our "Reading Code" skill.

Trisha Gee

September 11, 2019
Tweet

More Decks by Trisha Gee

Other Decks in Programming

Transcript

  1. https://www.stilldrinking.org/programming-sucks “Every programmer occasionally, when nobody’s home, turns off the

    lights, pours a glass of scotch, puts on some light German electronica, and opens up a file on their computer. They read over the lines, and weep at their beauty….”
  2. https://www.stilldrinking.org/programming-sucks “This file is Good Code. It has sensible and

    consistent names for functions and variables. It’s concise. It doesn’t do anything obviously stupid…. It reads like poetry written by someone over thirty.”
  3. Badass: Making Users Awesome Kathy Sierra “After enough exposure with

    feedback, your brain began detecting patterns and underlying structures, without your conscious awareness. With more exposure, your brain finetuned its perception and eventually figured out what really mattered. Your brain was making finer distinctions and sorting signal from noise even if you couldn’t explain how. It was just your brain learning... without bothering you with all those pesky details”
  4. Twelfth Night William Shakespeare If music be the food of

    love, play on, Give me excess of it; that surfeiting, The appetite may sicken, and so die.
  5. The Canterbury Tales, and Other Poems Geoffrey Chaucer Whylom, as

    olde stories tellen us, Ther was a duk that highte Theseus; Of Athenes he was lord and governour, And in his tyme swich a conquerour, That gretter was ther noon under the sonne.
  6. Everything Bad is Good for You: How Popular Culture is

    Making Us Smarter Steven Johnson “If you don't think about the underlying mechanics of the simulation— even if that thinking happens in a semiconscious way—you won't last very long in the game. You have to probe to progress.”
  7. “The game scholar James Paul Gee breaks probing down into

    a four-part process, which he calls the ‘probe, hypothesize, reprobe, rethink’ cycle” Everything Bad is Good for You: How Popular Culture is Making Us Smarter Steven Johnson
  8. Good Omens Neil Gaiman & Terry Pratchett “It may, or

    may not, have helped Anathema get a clear view of things if she’d been allowed to spot the very obvious reason why she couldn’t see Adam’s aura. It was for the same reason that people in Trafalgar Square can’t see England.”
  9. The Giant of Jum Elli Woollard & Benji Davies “I’m

    grizzly and grumpy and grouchy and grumbly I’ve not been called lovely before!”
  10. Clean Code: A Handbook of Agile Software Craftsmanship Robert C.

    Martin “Indeed, the ratio of time spent reading versus writing is well over 10 to 1.”
  11. “Indeed, the ratio of time spent reading versus writing is

    well over 10 to 1. We are constantly reading old code as part of the effort to write new code. ...[Therefore,] making it easy to read makes it easier to write.” Clean Code: A Handbook of Agile Software Craftsmanship Robert C. Martin
  12. Pride & Prejudice Jane Austen “My fingers,” said Elizabeth, “do

    not move over this instrument in the masterly manner which I see so many women’s do. They have not the same force or rapidity, and do not produce the same expression. But then I have always supposed it to be my own fault — because I will not take the trouble of practising. It is not that I do not believe my fingers as capable as any other woman's of superior execution.”