Preface

We’ve worked at highly successful software companies, with outstanding engineers, and the code we encounter still has plenty of room for improvement. In fact, we’ve seen some really ugly code, and you probably have too.
But when we see beautifully written code, it’s inspiring. Good code can teach you what’s going on very quickly. It’s fun to use, and it motivates you to make your own code better.
The goal of this book is help you make your code better. And when we say “code,” we literally mean the lines of code you are staring at in your editor. We’re not talking about the overall architecture of your project, or your choice of design patterns. Those are certainly important, but in our experience most of our day-to-day lives as programmers are spent on the “basic” stuff, like naming variables, writing loops, and attacking problems down at the function level. And a big part of this is reading and editing the code that’s already there. We hope you’ll find this book so helpful to your day-to-day programming that you’ll recommend it to everyone on your team.
What This Book Is About
This book is about how to write code that’s highly readable. The key idea in this book is that code should be easy to understand. Specifically, your goal should be to minimize the time it takes someone else to understand your code.
This book explains this idea and illustrates it with lots of examples from ...