DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Keep It CLEAN

In this post, one of our MVBs explains his acronym for creating great code, CLEAN, an how it aids in the development process.

David Bernstein user avatar by
David Bernstein
CORE ·
Apr. 14, 17 · Opinion
Like (2)
Save
Tweet
Share
4.77K Views

Join the DZone community and get the full member experience.

Join For Free

I like dirty martinis and R-rated movies but my code is one place I always want to keep it CLEAN.

CLEAN is an acronym I use to remind myself of the five key code qualities that I’ve found to have the biggest impact for improving the maintainability and extendibility of code.

Before I describe exactly what they are I just want to say that this is certainly not an exhaustive list, and it may not include all the qualities you look for in code.

But these are the ones I’ve found to be the easiest for me to call out and talk about with other people. They’re also the ones I’ve found to have the highest value.

For me, software quality is all about dropping the cost of ownership.

Quality in manufactured goods helps extend the longevity of the product. Higher quality products last longer. The same is true with software. Higher quality software should be able to last longer because it’s more fit for its purpose and it’s built to be extendible. So when the customer inevitably comes back with requests for improvements, the development team can implement those requests and make the customer happy. It may be a simple definition of quality, but it’s a useful one.

And these qualities are quantitative. We can measure them in code. This makes them useful for helping us arrive at a consensus for what principles and practices to follow. They give us a rubric for evaluating basically everything we do in terms of writing code and building features.

And these qualities aren’t just present in code, we see them everywhere in the world around us—in the way we communicate, in our literature, and in the media we consume. They’re everywhere because they reflect how we like to process and understand the world.

I’ll cast these code qualities in terms of object-oriented programs because that’s what I’m most familiar with, but these qualities are also present in languages from assembly to COBOL. Regardless of the programming language, we have the ability to create independent units of execution either as objects or as processes, and the more sophisticated the language the more capable we are of being able to create well-defined entities.

CLEAN relates to the consistency and relationship between entities. These should have well-defined characteristics, that is they should be focused in terms of their composition and in terms of their relationships. They should hide implementation details. They should treat each other autonomously and be defined in only one place.

We have names for each of these things and here they are:

  • Cohesive.
  • Loosely coupled.
  • Encapsulated.
  • Assertive.
  • Non-redundant.

The first letter of each of these words spells the word CLEAN. This is my acronym for code quality. I want my code to be CLEAN.

CLEAN code is also a shout-out to Uncle Bob Martin’s book, Clean Code: a Handbook of Agile Software Craftsmanship and to Misko Hevery’s, The Clean Code Talks: A Google Tech Talk. These are both great resources for developers. There really aren’t many places to go to learn software development beyond the basics. I think 99% of all the books out on software development are beginner books, and it’s really hard to find good material for professional software developers who are looking to further their craft. These are both excellent resources for developers wanting to improve their skills.

But our discussion of CLEAN code won’t touch on either of these resources because I’ve done what we developers are great at doing: I’ve overloaded the term to mean something else entirely.

Before you throw tomatoes, virtually speaking, I’d just like to point out that this is how we make concepts memorable and understandable. Software development, and language, in general, is full of overloaded terms and yes, there is room for one more.

So there it is: Write CLEAN Code. In the next several posts let’s talk about what CLEAN really means.

Software development IT

Published at DZone with permission of David Bernstein, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • The Future of Cloud Engineering Evolves
  • Top 12 Technical Skills Every Software Tester Must Have
  • Streamlining Your Workflow With the Jenkins HTTP Request Plugin: A Guide to Replacing CURL in Scripts
  • Memory Debugging: A Deep Level of Insight

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: