2 Speed reading for code

 

This chapter covers

  • Understanding why reading code quickly is hard, even if you are an experienced developer
  • Dissecting how the brain splits up new information into recognizable parts
  • Understanding how long-term and short-term memory work together when analyzing information like words or code
  • Comprehending the role of iconic memory when processing code
  • Demonstrating how remembering code can be used as a tool for (self) diagnosis of coding level
  • Learning how to write code that is easier for others to read

Chapter 1 introduced three cognitive processes that play a role when programming and reading code. The first cognitive process we covered was long-term memory, which you can think of like a hard drive that stores memories and facts. The second cognitive process is short-term memory, which is like random-access memory, storing information that comes into the brain for a short time. Finally, there’s the working memory, which acts a bit like a processor and processes information from long-term and short-term memory to perform thinking.

The focus of this chapter is on reading code. Reading code is a larger part of a programmer’s working life than you might realize. Research indicates that almost 60% of programmers’ time is spent understanding code, rather than writing code.[1] Thus, improving how quickly you can read code, without losing accuracy, can help you improve your programming skills substantially.

2.1      Quickly reading code

 
 
 
 

2.1.1      What just happened in your brain?

 
 
 

2.1.2      Reexamine your reproduction

 
 
 
 

2.1.3      A second attempt at remembering Java

 
 
 

2.1.4      Reexamining your second attempt at reproducing code

 
 
 
 

2.2      Why is reading unfamiliar code hard?

 
 
 
 

2.3      Remembering more code by using long-term memory

 
 
 
 

2.3.1      Experts’ memories differ from beginners’

 
 

2.3.2      Chunking in code

 
 

2.3.3      Expert programmers can remember code better than beginners

 

2.4      You see more code than you can read

 

2.4.1      Iconic memory

 
 

2.4.2      Iconic memory and code

 
 

2.5      It ain’t what you remember, it’s the way you remember it

 
 

2.5.1      How to write “chunkable” code

 
 

2.5.2      Practice chunking

 
 

2.6      Summary

 
 
 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest