Channels ▼

Developer Reading List

, December 03, 2013 Ruby, Python, ASP.NET, Android development, PDF, and more.
  • E-mail
  • Print

Python in Practice

Mark Summerfield's books are about the best in class, regardless of what topic he takes on. Last year, for example, Dr. Dobb's excerpted several chapters of his book on Google's Go language. Earlier in my career, I relied heavily on Summerfield's book about the Qt toolkit to become familiar with its rich capabilities. Summerfield knows how to write and how to present programming topics intelligently. I particularly like his refusal to avoid hard topics by relegating them to material that are "not in the scope of this book." He's mastered the presentation of dense material.

In this new volume, he fills a hole found in many books today — instruction on how to use tools (here, Python) well once their basics have been mastered. This is a constant problem with learning a new language: How does one learn to code idiomatically? And within the idiom, intelligently? That's what this book is about — good Python programming once the language has been thoroughly learned. (I should point out this volume uses Python 3 exclusively without providing the usual patches for Python 2. This can be viewed as a hassle or the inevitable reminder of the need to move on from version 2.x. )

The first few chapters explain most of the Gang of Four design patterns in Python. He spends 140 pages on patterns, which I think is an almost perfect amount. It's not so much that you never get through it, but plenty enough so that you can see how each pattern is coded and how to express it idiomatically. My one hesitation in this effort is his attempt to implement the interpreter pattern. Like its forebear in the Gang of Four book, the implementation is far too superficial for anyone to apply it usefully.

After patterns, the author tackles concurrency (with separate sections on CPU-bound and I/O-bound concurrency), integration with other languages, high-level networking, and writing portable GUIs. The latter topic is based on Tkinter — the Python wrapper around the Tk toolkit and Tcl engine, themselves wrapped in the Python runtime. Now that Tkinter allows themed appearance that is closer to the native look and feel of the runtime platform, this choice of library is workable. But as Summerfield suggests, it's hardly optimal. Tkinter lacks many features found in other GUI frameworks but has the benefit of being part of the Python distribution. Nonetheless, this book shows how much can be done even within the toolkit's limitations.

This book is a grab-bag of disparate topics, but that is, in some ways, a virtue: Almost any Python program beyond simple scripts is likely to touch on one area or another that Summerfield covers. And when that happens, you'll find this text to be a useful and insightful guide.






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.