7 Misconceptions: Bugs in thinking

 

This chapter covers

  • How knowing one programming language can help you learn a new one
  • Avoiding problems when learning a second programming language
  • Understanding how the brain can hold misconceptions and how misconceptions lead to bugs
  • How to avoid misconceptions in thinking and prevent bugs

In the last few chapters, we covered techniques for thinking about code, such as creating visualizations, using frameworks to support the working memory, and using mental models to help solve code problems. No matter how helpful the techniques are that we use to support our brains, we will sometimes make mistakes in thinking about code.

The focus of this chapter is bugs. Sometimes bugs are the result of sloppiness, for example, when you forget to close a file or make a typo in a filename. More often, though, bugs are the result of a mistake in thinking. You might not know that a file needs to be closed after use, or you might assume that the programming language closes the file for you automatically.

7.1 Why learning a second programming language is easier than learning the first one

7.1.1 How to increase the chances of benefiting from existing programming knowledge

7.1.2 Different forms of transfer

7.1.3 Already knowing something: Curse or blessing?

7.1.4 The difficulties of transfer

7.2 Misconceptions: Bugs in thinking

7.2.1 Debugging misconceptions with conceptual change

7.2.2 Suppressing misconceptions

7.2.3 Misconceptions about programming languages

7.2.4 Preventing misconceptions while learning a new programming language

7.2.5 Diagnosing misconceptions in a new codebase

Summary