Sunday, August 9, 2009

Python Essential Reference, 4th Edition (Developer's Library)

Author: David M. Beazley Format: Paperback, 744 pages Publisher: Addison-Wesley Professional; 4th edition (July 19, 2009) ISBN-10: 0672329786 ISBN-13: 978-0672329784 The key feature of this edition of the reference guide, is the presence of both Python 2.6 and 3.0. If you're savvy enough to be reading a review about a Python reference text, you know that Python 3.0 breaks backwards compatibility. This is a big deal in terms of how Beazley chose to update his book. To quote, "...I have chosen to omit features of Python 2 that have been removed from Python 3". Beazley also doesn't include those features in Python 3 that haven't been back-ported. This approach is the author's attempt to make the book equally serve programmers using 2.x vs. 3.0. Not that this is the only update the text has to offer. Beazley includes Python's newer features, particularly related to functional and meta-programming, resulting in the expansion of the chapters on functions and object-oriented programming, covering, for example, coroutines, decorators, and generators. The library chapters have also been updated to include modern Python modules, and the code examples and fragments reflect these upgrades. The book doesn't reinvent the wheel (just about a ton of documentation on Python already exists), but the advantage of this book is its organization, and the fact that all the data is located in the pages between the book's two covers. Keep in mind, that this isn't a tutorial, but a reference guide. While an experienced programmer could probably learn how to program in Python from this book, someone just learning programming probably could not. Chapter 1 is a self contained Python tutorial, but it's less than 20 pages long, and meant to bring an experienced programmer who's not experienced with Python up to speed. There are plenty of other good books on the market that teach Python, such as Practical Programming: An Introduction to Computer Science Using Python and Programming in Python 3 (depending on your perspective and requirements), so don't rely on Beazley's book to teach you Python from scratch. Actually, one of the few disadvantages of a hard copy book, is that it's not searchable the way the web is searchable. That said, you can still reasonably expect to hone in on what you're looking for, thanks to the excellent organization of the book. You do however, have to depend on the TOC and index. The only appendix in the book is Python 3. As appendices go, it's not too long, at just under 20 pages. It starts out with the $64,000 question: "Who Should Be Using Python 3?" Some Python programmers might be asking questions like, "if it ain't broke, why did you fix it?" With documentation still a bit lacking for Python 3, and major Python libraries and frameworks not yet ported to the latest version, using Python 3 might seem more of a "broken" than a "fix". While these issues are likely to be remedied with the passage of time, is there a justifiable reason to use Python 3 now? According to the author, in its current state, Python 3 is suitable only for experimental use by veteran programmers. For stability and usability, Beazley recommends sticking with Python 2.x in production environments. While the main body of the book attempts to blend the features that are workable in both versions, the appendix lists those features that are only supported in Python 3. This is just a brief introduction to Python 3. For more details, see Programming in Python 3. The ultimate strength of this book isn't just what's been updated, but what has stayed the same. Beazley writes and maintains a really great Python reference. The reviews for the 3rd edition are off the charts, and there's no reason to believe that the current edition won't garner the same accolades. Programmers who are heavily into Python or are trying to learn, will find themselves thumbing through this text often, to put their fingers on this particular detail or that. Time to put away your dog eared copy of the 3rd edition. The new replacement is here.