Five Must-Read Books to Write Maintainable Code
Writing high-quality code is not at all trivial and there is no shortcut to “add” quality in source-code. Quality is like spices in food; you need to add them at the right moment. You can’t just throw the spices in the vessel once the food is (almost) cooked and expect the great results.
Okay, if there is no shortcut to quality what is the detour to quality? Well.. in one word — “Learning” is the answer (no surprise, right?).
We learn from ourselves (by making mistakes and gaining experience) and from others (by reading about or listening to others’ experiences and knowledge). However, when it comes to reading books, there are many books on this topic!
In this post, I am presenting a set of books on code-quality that I consider every developer must read and follow. I refer to these books the “gold-set of books on code quality”. Obviously, there are many other good books; this is only a gold-set based on my limited experience.
Next, I briefly describe each book in the set ordered by their publishing year.
1. Refactoring: Improving the Design of Existing Code
by Martin Fowler
This book is a classic. It made refactoring the mainstream concept in software development. The “smell” metaphor was first introduced in this book by Mr. Beck and Mr. Fowler. Various refactoring techniques were introduced which are actively used today by developers worldwide.
2. Code Complete 2
by Steve McConnell
This book is known for its encyclopedic coverage of almost all aspects of programming from data and control structures, class design, defensive programming, managing conditionals, testing, debugging, and refactoring. It was one of the first books (if not the first) to talk about self-documenting code and craftsmanship.
3. Code Quality: The Open Source Perspective
by Diomidis Spinellis
This book is on the list because it exposes a reader to different facets of code quality including portability, reliability, and maintainability. The book does a good job in not only explaining the potential issues and common mistakes associated with various quality attributes but also provides enough details to make a reader understand the underlying concept completely.
4. Clean Code: A Handbook of Agile Software Craftsmanship
by Robert C. Martin
This is another landmark book in this domain. It introduced the famous boy scout rule which is considered as an effective guideline to maintain high code quality for evolving software systems. Additionally, the book provides a comprehensive list of best practices to write highly maintainable code.
5. Refactoring for Software Design Smells: Managing Technical Debt
by Girish Suryanarayana, Ganesh Samarthyam, Tushar Sharma
This book is not in the gold-set because I co-authored it (well ... may be) instead because it is the most comprehensive catalog and reference for design smells. The book follows a template to describe each smell. The template includes definition, rational, and aliases of a design smell, examples and corresponding refactoring suggestions, and quality attributes potentially impacted by the smell. War stories introduced while describing almost all smells make the book interesting and closer to the reality.