© Carleton DiLeo 2019
C. DiLeoClean Rubyhttps://doi.org/10.1007/978-1-4842-5546-9_1

1. The Qualities of Clean Code

Carleton DiLeo1 
(1)
Boulder, CO, USA
 

So what is clean code? If you ask three different developers, you will get three different answers. It’s a hard concept to define. You know clean code when you see it, as if written by a programming wizard from a distant land. We all want to write good code that others admire. Sometimes we don’t know where to start. How do we take our messy, unorganized code and turn it into something beautiful?

Many factors determine clean code, but we will focus on these:
  • Readable

  • Easy to change

  • Straightforward

Examine code you’ve written. How many of those questions can you answer yes? It’s unlikely you said yes to ...

Get Clean Ruby: A Guide to Crafting Better Code for Rubyists now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.