Book Summary: The Clean Coder by Robert C. Martin
4 min readMar 21, 2021
This is my first summary of a book. I wrote the notes for this book in 2019 and I still remember most of its points which I have implemented in my professional career. They have been really helpful throughout my journey and this is the reason why I thought of sharing the summary with you all. The book is The Clean Coder by Robert C. Martin.
1. Professionalism
- Take responsibility for what you do.
- Must know your code works - be confident on test cases of the code.
- Do no harm to structure - code should be open for extension but closed for modification.
- Work ethics - Our career is our responsibility. We should take out time for ourselves to study out of the work hours.
- Know Your Field - minimal things to know:
▹ Design Patterns - GOF and POSA books
▹ Design Principles - SOLID
▹ Methods - XP, Scrum, Lean, Kanban, Waterfall, Structured Analysis, Structured Design.
▹ Discipline - TDD, Object-Oriented Design, Structured Programming, Continuous Integration, Pair Programming.
▹ Artifacts - UML, DFDs, Structure Chart, Petri nets, State Transition Diagrams. - Try not to create bugs.
- QA should find nothing.
- Continuous Learning - read blogs, books, tweets, go to conferences. Learn things outside of your comfort zone.
- Practice - Repetition of a simple program to practice daily - kata. Eg. Calculate prime factors — fingers will run automatically.
- Collaboration and mentoring.
- Know the domain on which you are working on. Study books, blogs on the topic.
- Understand your customer and Clients.
2. Saying No - Do; or do not. There is no trying.
- Adversarial Roles (characterized by opposition/conflict) - Don’t stick to one person’s thoughts, try to have a conversation and understand the situation. Search for the best possible outcome.
- The most important time to say NO is when stakes are highest.
- Trying - you shouldn’t try until that’s the last option. Take full time for whatever you need. Give whatever it takes to do the work the right way.
3. Saying Yes
- Language of Commitment - There are 3 parts to making a commitment.
▹ You say you’ll do it.
▹ You mean it.
▹ You actually do it. - Learn how to say yes. Commit with discipline. Don’t force yourself. Always be clear in beginning.
4. Coding
- Never do coding in worry or at 3 am or during sleepless nights/rushing/overtime.
- Get very few interruptions while coding. Give your coding time to only coding.
- Help -
▹ Get help whenever needed. Programming is hard.
▹ Help and mentor others.
5. TDD - Test Driven Development
- Advantages
▹ Defect injection rate reduces.
▹ Courage - Having suites of tests we lose the fear of refactoring code because if anything bad happens tests will fail and we’ll have to do the clean up.
▹ Documentation - easy to understand what code is doing.
▹ Design - if we write tests first, there is no force preventing us from coupling the functions together into an untestable mass.
6. Practicing
- Skill sharpening exercises like all other artists do to be perfect like musician, singer, dancer.
- Coding Dojo - group of programmers meet and practice together like martial artists.
- Kata - practice such that to teach your body to make each movement perfectly like a precise set of choreographed keystrokes and mouse movements that simulates to solve program problem.
- Wasa - like two person kata.
- Randori - a game of wasa.
7. Acceptance Tests
- Communication requirements - things that appear on paper are different on paper than they do in a working system.
- Definition of done.
- Purpose - communication, clarity, and precision.
8. Testing Strategies
- QA should find nothing.
- Test automation pyramid.
- Unit tests ► Component tests ► Integration tests ► System tests ► Manual Exploratory tests
9. Time Management
- 8 hours is a short period of time ► 480 minutes ► 28,800 seconds. Use this time as effectively and efficiently as possible.
10. Estimation
- Commitment and estimation are 2 different things.
▹ Commitment - you must achieve. To be done by a certain date.
▹ Estimation - It’s a guess. No promise is made.
11. Pressure
- Avoid pressure.
- Communicate when under pressure. Do pair programming.
- Rely on your disciplines.
- Get help.
12. Collaboration
- The team is most effective when team members collaborate professionally.
13. Teams and Projects
- Continuously work on team bonding.
- Teams are harder to build than projects.
14. Mentoring, Apprenticeship, and Craftsmanship
- Schools teach the theory of CS but cannot teach the discipline, practice, and skill of being a craftsman.
- These are achieved by personal mentoring.