Python Programming Patterns, by Thomas W. Christopher, Prentice-Hall, 2002
This book is not an entry level book, but rather is about the application
of Programming Patterns. As such, I believe it succeeds in being a fine book,
even though, as a relative beginner, I may not be qualified to judge it properly.
Still, even as a relative beginner, I received some valuable insights into
programming larger projects.
The author defines moderately large programs as being 5000+ lines of code,
and the purpose of this book is to focus on themes that are helpful for such
projects. Nonetheless, the book does cover the basics of Pythonic syntax
and semantics, attempting to shine light on them from a somewhat more advanced
perspective. This is useful as a review of basic Python.
The core of the book is a description and exploration of Programming Patterns,
including Creational Patterns, Structural Patterns, and Behavioral Patterns.
Creational Patterns are used to create objects are are classified as Factory
Patterns, Prototypes, Singletons, and Builders. Structural Patterns are used
to structure data. Behavioral patterns are used to define the behavior of
objects, and include patterns such as Chains of Responders, Iterators, Visitors,
Observers, Commands, Mementos, and Interpreters.
The book also covers functions and functional programming, sequences, and
special methods and operators.
Abstract Container Data Types are covered in some detail, along with Priority
Queues, Sets and Set Operations, Concurrency and Threads, Transactions, Run
Queues, and Regular Expressions.
The book concludes with a full featured exploration of a Parsing Framework,
specifically the parsing generator, the TCLLk system. This system takes
context-free grammars and generates tables and functions that are usable
with not only Python, but also with Java and Icon. The code for use with
all three languages is available on the book's web site.
As I say, much of the book was over my head, in the sense that, as a hobbyist
coder, I am unlikely to ever write the kind of long programs that will truly
benefit most from these concepts. However, I found, to my pleasant surprise,
that the text was accessible enough to this novice to allow me to gain insight
into some of the reasoning that goes on in the creation of much larger programs
than I am likely ever to build. I consider such insight to be enjoyable,
and worth more than the price of the book.