*Guidelines for Readable Code: Toward Sustainable Software Development* (Munehisa Ishikawa, Gijutsu Hyoronsha, 2022) is a book that systematically explains what you need to understand and put into practice to write readable code, from the perspectives of naming, comments, state, functions, dependencies, and code reviews. To highlight a few points, the book discusses the following: Readable code is simple, easy to understand, independent, and well-structured. Names should concisely and descriptively express “what it does.” Conversely, they should not specify “how it is used” or “when and by whom it is used.” Comments serve two purposes: documentation and informal reading aids. The latter should be added only when the code alone is difficult to understand. Design variables that manage state so that they are mutually orthogonal. Ensure that state transitions are acyclic and idempotent. Clearly separate command functions for changing state from query functions for determining state. Unlike *Principles of Programming*, this book is rich in concrete code examples, which made it easier to understand even the concepts I was less familiar with.
Comments