The Art of Readable Code
The Art of Readable Code

Author: Dustin Boswell & Trevor Foucher
Publisher: O'Reilly
Pages: 204
ISBN: 978-0596802295
Aimed at: All programmers
Rating: 5
Pros: Practical, thought-provoking, amusing cartoons
Cons: You may have encountered ideas before
Reviewed by: Mike James


If you only read one book this year - make it this one.

It doesn't contain much that you cannot find elsewhere, and if you are an expert skilled programmer then you probably don't need to read it, but it is nicely explained and it has a modern take on the old advice.

There are many programmers who just learn to code without ever really thinking about what they are doing or how to do it. If you are one of these then The Art of Readable Code might open your eyes to better ways to do things - but only if you are ready for it.

The whole book is about avoiding the situation illustrated in the cartoon in the preface. A completely manic looking programmer works late at night on some code. The second frame shows the same programmer much calmer but clearly dejected two weeks later admitting that he has no idea what the code does or who wrote it. The argument is that programs have to be written to allow programmers to read and understand them in the shortest time possible.




Chapter 1 makes this argument and if you don't see the sense of it the rest of the book will be so much waste paper to you. In fact, if you don't agree with this basic premise, I doubt you would even understand the many cartoons that pepper the book. As long as you do, you'll find the cartoons highly amusing and a key element in the overall readability of the book.

The first part of the book is about "surface level" improvements which means issues like variable naming, line breaks, alignment, comments and so on. It is an easy read, but don't be fooled. Putting some of this advice into practice is hard, but at least you are now aware of the objective.

Part II of the book is about simplifying loops and logic. This covers how to write logic so that its meaning is clear. Using the ternary operator, types of loops, nesting and so on. The chapter on simplifying expressions so that they are understandable is essential reading. Expressions are a part of the code that seems to escape coding rules and any sort of desire to simplify. Indeed there is a school of programming that delights in writing the most complicated expressions possible to shorten the code.

Part III is on what you could call "refactoring", but it's about more than this. There is a chapter on multi-tasking, or more correctly on trying to keep things to one task at a time.

The book closes with some selected topics, including the subject of how to write readable tests and a final example of coding in a project.

Overall this is an easy read with code in a range of languages - C++, Java, JavaScript and so on. The cartoons actually help by making a point in an amusing way and there are lots of pull quotes to sum things up. You probably won't agree with everything that is recommended to make reading code easier - but you don't have to. The book isn't prescriptive. It doesn't insist that there is only one way to do the job. Instead it explains and argues its points and expects you to evaluate the situation to produce an outcome that satisfies you.

The Art of Readable Code isn't a ground breaking book, but it is an easy reminder of how to do things better.
Highly recommended.


Java 9 for Programmers

Author: Paul J. Deitel & Harvey M. Deitel
Publisher: Prentice Hall
Pages: 1120
ISBN: 978-0134777566
Print:  0134777565
Kindle: B071S84XCK
Audience: Programmers moving to Java; students
Rating: 3.5
Reviewed by: Ian Elliot

The latest edition of the Deitel tome on Java has be [ ... ]

Seven Languages in Seven Weeks

Author: Bruce Tate
Publisher: Pragmatic Bookshelf, 2010
Pages: 300
ISBN: 978-1934356593
Print: 193435659X
Kindle: B00AYQNR46
Audience: Language enthusiasts
Rating: 4
Reviewed by: Mike James


As the original title in the now familiar Seven ... In Seven Weeks series, this book was obviously  [ ... ]

More Reviews

Last Updated ( Saturday, 17 March 2012 )

RSS feed of book reviews only
I Programmer Book Reviews
RSS feed of all content
I Programmer Book Reviews
Copyright © 2018 All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.