Book Review: Expert Python Programming

When I find a technical book that looks interesting, I commit myself to reading one chapter of that book, but the occasion is rare when I actually finish the chapter. I usually go for the first chapter, but sometimes I pick one at random. I am looking for two things when I read it:

  1. teach me something new that I don't already know and
  2. get me excited about the book.

Expert Python Programming by Tarek Ziadé passed the test with flying colors. Not only did chapter one get me excited about the book, but it also taught me a couple of things I didn't know.

The book covers several topics that will make you a better Python programmer. Expert programmers are productive because they know how to use the language to express a solution in the least amount of code. Chapters two and three cover syntactic constructs and language features that will allow you to code like an expert pythonista. Chapter four focuses more on Python's naming conventions and coding style, which is an extremely important topic if you are distributing your code to a large audience. Chapter five and six are practical: they show the reader the best practices for writing packages and applications in Python, respectively.

Expert programmers are also productive because they are masters of leveraging tools for automating the more mundane aspects of software development. This book teaches you about the tools that will make you a more productive Python programmer. Chapter seven through eleven cover project lifecycle management tools such as build automation and distribution tools, source code control, testing, documentation and bug tracking. The focus is on how to leverage these tools in a Python project and it is very enlightening.

Chapters twelve and thirteen delve into performance and optimization in Python. Many treatments of the topic easily become fodder for a religious war, but Tarek's approach is well-grounded on two pillars: 1) Write code that works first and 2) Measure were the bottlenecks are before doing anything else. These chapters cover the tools you can use to find out where your performance problems are and the techniques you can use to get rid of the issues.

Chapter fourteen covers Design Patterns in Python, but it is not needed in this book. Others have written on the topic ad nauseum and Python syntax already supports a lot of the patterns. The canonical example of this are Python decorators, which allow the programmer to use the Decorator pattern by simply writing normal Python code, where most other imperative and object-oriented languages require you to write a complex hierarchy of cascading decorator objects.

The pièce de résistance of this tome is the fact that it outlines, in detail, the complete lifecycle of a professional software development project done in Python, using tools written in Python for serious pythonistas. The book is small when compared with most publications about Python, however, the insights that it provides are deep. Use it as a guide and a reference in your future Python projects and you are sure to become an Expert Python Programmer, as the title of the book implies.

In conclusion, Peter Norvig, who is the director of research at Google, has very eloquently written: ...the only sensible way to progress in any field is to get some practical experience first, and then acquire the theory necessary to understand what you did, and to allow you to do more. Expert Python Programming is the book that provides the necessary theory and practice to allow you to do more with Python.

Comments

Comments powered by Disqus