4 How to read complex code

This chapter covers:

  • Analyzing what happens when your working memory is overloaded by complex code
  • Comparing two different types of working memory overload when programming
  • Refactoring code for readability to compensate for an overloaded working memory
  • Creating a state table and a dependency graph to support your working memory when reading complex code

Chapter 1 introduced the different ways in which code can be confusing. We’ve seen that confusion can be caused by a lack of information, which must be acquired and stored in your STM, or by a lack of knowledge, which requires storing information in your LTM. This chapter covers the third source of confusion: a lack of processing power in the brain.

Sometimes the code ...

Get The Programmer's Brain now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.