12 Designing and improving larger systems

 

This chapter covers

  • Examining what effect different design decisions have on the understandability of codebases
  • Exploring trade-offs between different design decisions
  • Improving the design of existing codebases for better cognitive processing

So far in this book, we have discussed how to best read and write code. To do so, we have examined how cognitive processes play a role when reading and writing code. For larger codebases, however, it is not just small parts of code that influence how easy it is for people to comprehend it. The way in which you organize code also greatly influences how easily other people can interact with the code. This is especially true for code in libraries, frameworks, and modules that other programmers use rather than change.

Often when we talk about libraries, frameworks, and modules, we talk about their technical aspects, like the language they are created in. However, codebases can also be viewed through a cognitive lens. In this chapter we will discuss CDN, which is a technique to examine codebases from a cognitive perspective. CDN helps you answer questions about existing large codebases, such as “Will this code be easy for people to change?” or “Will this codebase be easy for people to find information in?” Examining codebases from a cognitive rather than technical perspective can help you gain a better perspective on how people interact with your code.

12.1 Examining the properties of codebases

12.1.1 Cognitive dimensions

12.1.2 Using CDCB to improve your codebase

12.1.3 Design maneuvers and their trade-offs

12.2 Dimensions and activities

12.2.1 Impact of dimensions on different activities

12.2.2 Optimizing your codebase for expected activities

Summary