DEV Community

Cover image for Clean Code Reimagined

Clean Code Reimagined

Nigel Dsouza on June 27, 2025

🎨 Patterns for Practical Elegance Engineering Resilience, Not Just Readability By Nigel Dsouza 📘 Preface Thi...
Collapse
 
senior-debugger profile image
Dmitrii Zakharov

I’d strongly recommend revisiting and rewriting this article — here are a few points that might help improve its quality:

  • Code formatting: It looks like ESLint isn’t being used. The code examples are difficult to read — objects should be split across multiple lines to improve clarity and structure.

  • Point 2 — terminology and logic: While I agree with the title, I can’t say the same for the content. Throwing exceptions in a validate function is perfectly acceptable and widely used (see Zod for reference). Also, naming a function saveToDB makes sense if you have entity-specific save methods. A normal example is needed.

  • Missing Node.js example: It’s unclear why Node.js isn’t included in point 3. Adding it would improve consistency and relevance.

Code style and syntax: The code lacks proper linting and indentation, which makes it hard to follow. It would be much more readable if broken into multiple lines. Also, consider using async/await—it’s generally cleaner and more intuitive than chaining .then and .catch.

This article is completely repeated: refactoring.guru/refactoring/what-... , not by example, but content.

Collapse
 
nigel10122 profile image
Nigel Dsouza

Hi Dmitrii,

Thank you so much for the thoughtful feedback and peer reviewing the article, I really appreciated how specific and constructive it was. I’ve taken your points seriously and completely rewrote the article. The code is now properly formatted with multi-line object literals, async/await is used instead of chaining, and I added the missing Node.js example for DRY logic. I also refined the validation logic and renamed vague functions like saveToDB() to make everything clearer. The updated version is called Clean Code Reimagined, would love for you to check it out when you get a chance. Thanks again, your feedback helped make it better.

Collapse
 
mcsee profile image
Maxi Contieri

cleancodecookbook.com/

There's already a clean code cookbook on O'Reilly

Collapse
 
nigel10122 profile image
Nigel Dsouza

Hi Maxi, totally valid point. I’ve since updated the piece and renamed it to Clean Code Reimagined to make it stand apart from O’Reilly’s book. I’ve also added new metaphors, unique formatting, and practical code examples in both Node.js and Java to give it a fresh angle. Appreciate the callout, it pushed me to rethink and improve the whole thing. Thanks.

Collapse
 
mcsee profile image
Maxi Contieri

thanks to you!

Collapse
 
krishna_rajagopal_8c76c0b profile image
Krishnagopal Rajagopal Nair

Clean code by Robert C Martin is an evergreen book with a lot of good practical examples in case you are interested!

Collapse
 
madhura_shetty_bf1e615dcc profile image
Madhura Shetty

Helpful insight!

Collapse
 
gina_mendonsa_e7e866b1031 profile image
Gina Mendonsa

Thanks for such a useful article. Keep up the good work!

Collapse
 
val_rebello_0602d01a8fe7e profile image
Val Rebello

It is good practice to document code so that it is readable and understandable to others and must become a habit but maybe due to time constraints this practice is lost along the way.

Collapse
 
gaurang_shetty_7ea695e7a4 profile image
gaurang Shetty

Insightful!!

Collapse
 
david_rasquinha_bebf6bd6e profile image
David Rasquinha

""Because clean code isn't just for you — it's for everyone who comes after you."" I found this the core of the issue and kudos to you for highlighting it.

Coming from the Y2K generation, which was also hugely limited in character capacity amongst others, this rings a clear bell. Code has to live on after its creator and be clear to those who come after.

A little more time and effort in code writing but a quantum jump in code utility going forward. Well said!!

Collapse
 
rajkaimal profile image
Rajendra Kaimal

Loved this! Nigel takes us through practical rules that make messy code neat and safe—using everyday examples like good names for things, keeping each job focused, and making errors easy to handle. It’s like cooking: pick fresh ingredients (clear names), follow easy steps (small functions), and spice it just right (useful logs). Even someone not deep in programming can see the sense: cleaner code means fewer surprises and less stress later. It’s not just for coders—it’s about building solid foundations that anyone coming after you will appreciate.

Collapse
 
vijay_dsouza_d1453840477d profile image
VIJAY DSOUZA

Thanks Nigel. Rather than just listing best practices, you encourage a shift in mindset that’s vital for every developer. The way you transform common anti-patterns into clean, maintainable code is both appreciative and powerful. From meaningful naming and focused functions to data-driven logic, each example strikes a perfect balance between clarity and real-world application. But best is your culinary metaphor, “prep your variables, follow a clean recipe, and taste before you ship,” It captures the heart of every coder brilliantly.

Collapse
 
petercr profile image
PETER CR

Absolutely agree that clean code is a practice....an ethic....a way of programming life!!
It needs to be in place early in life, else it may never happen!
Great use of examples to illustrate the point!!

Collapse
 
jason_lobo_5b17f0ff051f06 profile image
Jason Lobo

Definately worth reading. Thanks for sharing 👍

Collapse
 
nitmala profile image
Nirmala Shetty

Appropriciate your work . 👏👏👍

Collapse
 
rita_gonsalves_0987100d4a profile image
Rita Gonsalves

Interesting reading.
It’s been a log time since I did any coding.

Collapse
 
ohawnashetty profile image
ohawnashetty

Great read!

Collapse
 
piyush83 profile image
Piyush

Very well written Nigel, Brilliant. Thank you for sharing.

Collapse
 
sid_f2598feb517 profile image
Sid

Another approach I have been following lately is to not be very DRY. I only abstract things if it makes logical sense or if it's being repeated more than twice.