LWN.net Logo

The Art of Readable Code

From:  Gretchen Giles <gretchen-AT-post.oreilly.com>
To:  lwn-AT-lwn.net
Subject:  The Art of Readable Code--New from O'Reilly Media
Date:  Tue, 8 Nov 2011 01:01:33 -0800
Message-ID:  <1320742893.8944.0.901982@post.oreilly.com>
Archive-link:  Article, Thread

If you would like to view this information in your browser, click here:
http://post.oreilly.com/rd/9z1zmepg8jpcn7qp2i5ffpcf7s6fif...

For Immediate Release
For more information, contact:
Gretchen Giles (707) 827-7136, gretchen@oreilly.com, @oreillymedia

The Art of Readable Code--New from O'Reilly Media
Simple and Practical Techniques for Writing Better Code

Sebastopol, CA--As programmers, we've all seen source code that's so ugly and buggy it makes our
brains ache. Over the past five years, authors Dustin Boswell and Trevor Foucher have analyzed
hundreds of examples of "bad code" (much of it their own) to determine why it's bad and how it
could be improved. Their conclusion? You need to write code that minimizes the time it takes
someone else to understand it--even if that someone else is you.

The Art of Readable Code (O'Reilly Media, $34.99 USD) focuses on basic principles and practical
techniques you can apply every time. Using easy-to-digest examples from different languages, each
chapter demonstrates how you can make your code easy to understand.

"Most engineers just don't think about readability as consciously as they should," says Boswell. "I
wanted to write a book that would bring awareness to the issue, but also give specific tips and
guidance on how to do it. Specifically, I wanted to create a practical book that a junior developer
could start reading and immediately improve the readability of their code. There is also a real
need for programmers to read this book. The majority of code out there is unreadable.

"After reading this book," Boswell says, "you'll be able to look at your own code and realize why
it might be unreadable. More importantly, you'll be armed with a lot of principles and techniques
that will let you comb through your code to make it better."

- Simplify naming, commenting, and formatting with tips that apply to every line of code
- Refine your program's loops, logic, and variables to reduce complexity and confusion
- Attack problems at the function level, such as reorganizing blocks of code to do one task at a
time
- Write effective test code that is thorough and concise--as well as readable

Advance Praise
"Being aware of how the code you create affects those who look at it later is an important part of
developing software. The authors did a great job in taking you through the different aspects of
this challenge, explaining the details with instructive examples."
--Michael Hunger, software developer

For a review copy or more information please email gretchen@oreilly.com. Please include your
delivery address and contact information.

About the Authors
Although raised in the circus, Dustin Boswell realized early on that he was better at computers
than at acrobatics. Dustin received his B.S. from CalTech, where he got hooked on Computer Science,
and then went to UC San Diego for his Master's Degree. He worked at Google for five years, on a
variety of projects including web crawling infrastructure. Dustin is now an internet startup junkie
who spends his free time hiking the Santa Monica mountains and being a new dad.

Trevor Foucher has been shipping software projects for over 10 years, including Windows 2000 and
OneCare at Microsoft, and Webmaster Tools at Google. He's been an individual contributor, manager,
and tech lead. His goal is to make code more readable and reliable.

Additional Resources
For more information about the book, including table of contents, author bios, and cover graphic,
see:
http://post.oreilly.com/rd/9z1zki2ooamhi14ejdn3db3gdvg2ml...

The Art of Readable Code
Publisher: O'Reilly Media
By Dustin Boswell, Trevor Foucher
Print ISBN: 9780596802295
Pages: 204
Print Price: $34.99, Ebook Price: $27.99
order@oreilly.com
1-800-998-9938
1-707-827-7000

About O'Reilly
O'Reilly Media spreads the knowledge of innovators through its books, online services, magazines,
and conferences. Since 1978, O'Reilly Media has been a chronicler and catalyst of cutting-edge
development, homing in on the technology trends that really matter and spurring their adoption by
amplifying "faint signals" from the alpha geeks who are creating the future. An active participant
in the technology community, the company has a long history of advocacy, meme-making, and
evangelism.

# # #

O'Reilly is a registered trademark of O'Reilly Media, Inc. All other trademarks are the property of
their respective owners.

You are receiving this email because you are a public relations contact with O'Reilly Media. If you
would like to stop receiving any and all press releases from O'Reilly, please email
press@oreilly.com.

O'Reilly Media, Inc. 1005 Gravenstein Highway North, Sebastopol, CA 95472 (707) 827-7000




(Log in to post comments)

The Art of Readable Code

Posted Nov 10, 2011 8:49 UTC (Thu) by gasche (subscriber, #74946) [Link]

authors Dustin Boswell and Trevor Foucher have analyzed hundreds of examples of "bad code" [..]. Their conclusion? You need to write code that minimizes the time it takes someone else to understand it
How surprising. I would never have thought of it.

My problem with these books is that I never know whether they will only talk about trivial things we already know, or if there are interesting bits inside.

I would *love* to find a good book on the topic, full of crystallized knowledge about good code. Not everything in such a book needs to be disruptive innovation : it's also good to capture something we already vaguely knew, putting a name and a cohesive structure on it.

This description really does not look like its a good book in this category. It is obvious and boring -- except the circus part. I hope the book is better.

I think a good selling pitch would be to give one of the interesting insights of the book. For example, one of the numerous other books on the topic (I don't remember which one, sorry) said that we should not only abstract parts of the logic of a function into a separate subfunction, but that in a given function code the abstraction level should be homogeneous: it's not very good when you mix low-level stuff and very-abstracted stuff in the same place. That's an idea -- if not world-changing and even probably false in some circumstances -- that I found non-obvious and interesting. On the contrary, "one task at a time", "simplify formatting" and "reduce complexity" are pure common sense.

The Art of Readable Code

Posted Nov 11, 2011 14:42 UTC (Fri) by zmower (subscriber, #3005) [Link]

The Design Patterns (Erich Gamma et al) book specifies some reusable designs and gives us some common language. However it's a bit too C++/GUI interface to be generally applicable. I'd rather recommend anything by Leon Starr to do with modelling. If the design is good then the code is more likely to follow.

The Art of Readable Code

Posted Nov 15, 2011 12:29 UTC (Tue) by vonbrand (subscriber, #4458) [Link]

You are looking for The Elements of Programming Style by Kernighan and Plauger. Dates, but truly fascinating. Beware, (as those people are so prone to) what looks trivial in their hands is a mayor task for mere mortals.

Copyright © 2011, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds