# Sandrine Banas - The Art of Code (Highlights) ![rw-book-cover|256](https://readwise-assets.s3.amazonaws.com/media/uploaded_book_covers/profile_155788/d814cad4568c4a6cb8a7e66350bca5da.jpg) ## Metadata **Review**:: [readwise.io](https://readwise.io/bookreview/62269174) **Source**:: #from/readwise #from/manning **Zettel**:: #zettel/fleeting **Status**:: #x **Authors**:: [[Sandrine Banas]] **Full Title**:: The Art of Code **Category**:: #books #readwise/books **Category Icon**:: 📚 **Highlighted**:: [[2026-07-25]] **Created**:: [[2026-08-01]] ## Highlights ### 2 Narrative code - Levels of narrative: action, scene, chapters, and table of contents ([View Highlight](https://livebook.manning.com/book/the-art-of-code/chapter-2/v-3/62187e40c85399c1129901ece9ce91a3)) ^1037240025 - In code, actions are low-level methods handling raw mechanics: running a query, checking a condition, or sending a message to a queue. These methods should contain only one chunk, maybe two at most, focused on that specific action. ([View Highlight](https://livebook.manning.com/book/the-art-of-code/chapter-2/v-3/17c096d9d1ccb862fd99b456add97739)) ^1037240026 - In code, scenes are mid-level methods that group several method actions into a meaningful step. ([View Highlight](https://livebook.manning.com/book/the-art-of-code/chapter-2/v-3/3fad50c41b7b250bd46be4cebd95fb55)) ^1037240027 - In code, chapters are high-level methods that act as orchestrators, for instance, registering a user, starting with field validation and ending with saving the user to the database. ([View Highlight](https://livebook.manning.com/book/the-art-of-code/chapter-2/v-3/5a6f922676aa1bb4770f6c4fd2d1c295)) ^1037240028 ### 3 The complex art of simplicity - The most widely known metric for code complexity is cyclomatic complexity, inspired by a measure introduced by Thomas McCabe in his 1976 paper, “A Complexity Measure,” published in IEEE Transactions on Software Engineering. The core idea is simple: evaluate complexity by counting the number of independent execution paths through a method, identified by decision points such as if, while, or switch statements. ([View Highlight](https://livebook.manning.com/book/the-art-of-code/chapter-3/v-3/9b5c50722f7ccaaf6db70ec652d02455)) ^1037240030 - In 2016, SonarSource introduced a new model for measuring complexity called cognitive complexity (https://www.sonarsource.com/resources/cognitive-complexity/) and added it to their static analysis tool, SonarQube available for many languages such as Java, C#, C++, Python, JavaScript, and TypeScript. Cognitive complexity goes further than cyclomatic complexity by penalizing control structures that increase cognitive load, such as deep nesting and mixed logical operators. ([View Highlight](https://livebook.manning.com/book/the-art-of-code/chapter-3/v-3/72bf75d28138e85086e37e0733803551)) ^1037240031 - Simplicity can also be supported by an AI skill. Claude Code includes a bundled skill that can be invoked with the /simplify command. ([View Highlight](https://livebook.manning.com/book/the-art-of-code/chapter-3/v-3/42d3ee5f428bd636c8c7b97c9cf9dd6b)) ^1037240032