9 Avoiding bad code and cognitive load: Two frameworks
This chapter covers
- Explaining the connection between code smells and cognitive processes, especially cognitive load
- Surveying the connection between bad names and cognitive load
As a professional programmer, I am sure you have seen code that was easy to read, as well as code you had to spend a lot of effort to understand. The reason code can be hard to understand is something we covered in earlier chapters when discussing STM, LTM, and working memory: you are experiencing too much cognitive load. Cognitive load happens when your working memory becomes too full and your brain cannot properly process anymore. In earlier chapters, we focused on how to read code. We have seen that sometimes ...
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.