Book review: Clean Code

Posted On Nov 05, 2023 |

Book review: Clean Code

Book Summary

"Clean Code" by Robert C. Martin, often referred as a “bible” for programmers, offers valuable insights to anyone wanting to enhance their programming skills. It was the very first programming book that was not a typical “html+css” tutorial, but one of the few where I recognized myself in it clearly. It challenged my mindset about the tasks of the developers, and whether you've been a programmer for a decade or just starting, this book help improve your code and career.

"Clean Code" is not just about writing codes; it is about respecting the craft and sharpening our skills. It's a guide to make our code cleaner and more digestible, making it easier for ourselves and for others to comprehend. It dissects the mind of programmers, addressing common struggles and providing solutions that not only clean your code but improve its functionality and your programming practice.

Here are three key takeaways, critiques, and tasks:

My Three Takeaways:

  1. Understanding Code is Essential: All the twisted and curvy lines of code we float through everyday may seem convoluted, but understanding them is of utmost importance. According to Mr. Martin, the cleaner the code we write, the easier it becomes to understand and, by extension, to develop new ones.
  2. Bad Code Can Destroy: As one project led to another in my career, one thing became dreadfully clear - Bad code brings companies down. When quick fixes become permanent, the code becomes a monster that is impossible to maintain.
  3. The 'Campground Rule' in Coding: Another striking lesson imparted was to "leave the campground cleaner than you found it" - implying the importance of refactoring your code for assured control over it.

My Critiques

However, "Clean Code", like all texts, isn't without its points of contention. Here are my divergent observations:

  1. The Lengthy Read: Despite the insightful start, "Clean Code" tapered off towards the end, discouraging a complete read.
  2. A Touch of Irrelevance: While most principles presented were universally applicable, some Java-oriented examples could seem irrelevant for web or frontend developers.
  3. Unnecessary Complexity: In my personal opinion, the heavy separation of processes the book recommends could be excessive for simpler web apps.

Despite these disagreements, the book still holds valuable knowledge, and I encourage you to read it with an open, discerning mind.

My Three Tasks

Well, readings are futile if we don’t do any action. Therefore, in the upcoming months I will focus on the following:

  1. Shorten function arguments: Overgrown argument lists are usually a sign that a function is doing more than it should. Aim for simplicity.
  2. Avoid side effects: Ensure that my classes and components don't alter the global application state, adding to the code's purity and stability.
  3. Remove Dead Code: Keeping old, unused code is tempting, but it usually adds unnecessary confusion and clutter. If need be, it's always there in GIT history.

I encourage you to apply these, or your own learnings and experience in your coding skills and career.

Remember, "the only way to make the deadline - the only way to go fast - is to keep the code as clean as possible at all times."

Watch the full video for more thoughts, and download “PDF book companion & contract“ with more takeaways and action sheet to help you get the most out of this book. You can print it out, write down your own tasks, and keep it with the book for easier reference later. Or keep it as a reminder while you are coding.

Until the next time, keep learning, and stay curious!

Categories: : Book Reviews