Washing your code
Washing your code
Write once, read seven times
About the Book
The purpose of this book is to show common code smells or patterns that often (but not always!) lead to poor code readability, and how you can refactor the code to make it more readable and maintainable. The book contains a lot of code examples, mostly based on real code with only minor adaptations.
Who is this book for
The book probably will be most useful for intermediate developers. If you’re a beginner, you probably have enough of other things to think about. If you have decades of experience, you probably can write a similar book yourself. This book is going to be opinionated, but you don’t have to agree with everything I’m saying, and that’s not the goal of the book. The goal is to show you one possible path, mine, and inspire to find your own. These techniques help me to write and review code every day, and I’ll be happy if you find some of them useful.
What you will learn
I’ll show code smells and patterns I often see during code reviews (and I review a lot of code every day!) and will walk you through the refactoring process to make code more readable and maintainable. I’ll also show when you shouldn’t follow my recommendations and keep using smelly code.
I’ll show you how to:
- Replace loops with array methods.
- Replace conditions with tables or remove them entirely.
- Replace imperative code with declarative and separate “what” and “how.”
- And more.
Table of Contents
Other books by this author
The Leanpub 60-day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms
80% Royalties. Earn $16 on a $20 book.
We pay 80% royalties. That's not a typo: you earn $16 on a $20 sale. If we sell 5000 non-refunded copies of your book or course for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earnedover $12 million USDwriting, publishing and selling on Leanpub.
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them