6 Getting better at solving programming problems

 

This chapter covers

  • Applying models to reason about programming problems more effectively
  • Discovering that different ways of thinking about problems can influence the way we solve them
  • Exploring the use of models to think about code and solve problems more effectively
  • Examining techniques to learn new ways to solve problems by improving LTM
  • Practicing techniques to use models to solve problems by supporting working memory
  • Analyzing to scope problems correctly by abstracting irrelevant details and including important ones

In the previous chapters, you learned about different cognitive processes active in the brain when programming. We explored how information is stored briefly in the STM while reading code and how information is retrieved from the LTM when it needs to be applied. We also discussed the working memory, which is active when we think about code. Then, in chapter 5, we discussed strategies for deeply engaging with unfamiliar code.

The focus of this chapter is how we solve problems. As a professional programmer, you will often weigh different solutions to problems. Will you model all the customers of a company as a simple list or as a tree, organized by their default branch? Will you use an architecture based on microservices or should all the logic be in one place?

6.1 Using models to think about code

6.1.1 The benefits of using models

6.2 Mental models

6.2.1 Examining mental models in detail

6.2.2 Learning new mental models

6.2.3 How to use mental models efficiently when thinking about code

6.3 Notional machines

6.3.1 What is a notional machine?

6.3.2 Examples of notional machines

6.3.3 Different levels of notional machines

6.4 Notional machines and language

6.4.1 Expanding sets of notional machines

6.4.2 Different notional machines can create conflicting mental models

6.5 Notional machines and schemata