Books : reviews

Luciano Ramalho.
Fluent Python: clear, concise and effective programming.
O'Reilly. 2015

rating : 2 : great stuff
review : 27 June 2019

Python’s simplicity lets you become productive quickly, but this often means you aren’t using everything it has to offer. With this hands-on guide, you’ll learn how to write effective, idiomatic Python code by leveraging its best—and possibly most neglected—features. Author Luciano Ramalho takes you through Python’s core language features and libraries, and shows you how to make your code shorter, faster, and more readable at the same time.

Many experienced programmers try to bend Python to fit patterns they learned from other languages, and never discover Python features outside of their experience. With this book, those Python programmers will thoroughly learn how to become proficient in Python 3.

This book covers:
The Python data model: understand how special methods are the key to the consistent behavior of objects
Data structures: take full advantage of built-in types. and understand the text versus bytes duality in the Unicode age
Functions as objects: view Python functions as first-class objects. and understand how this affects popular design patterns
Object-oriented idioms: build classes by learning about references. mutability. interfaces. operator overloading, and multiple inheritance
Control flow: leverage context managers, generators, coroutines, and concurrency with the concurrent.futures and asyncio packages
Metaprogramming: understand how prOperties. attribute descriptors. class decorators. and metaclasses work

There are (at least) three levels of writing code. The lowest level is writing applications for your own use. Then there is writing applications for others to use, requiring a more solid software engineering approach, and a more effective use of the programming language. And then there is writing application frameworks, for others to use when they are writing applications. This level requires the most sophisticated software engineering, and the most proficient use of the implementation language, to ensure solid, reusable, flexible, and effective frameworks.

This splendid book helps provide increased fluency in Python. Some of the topics are suitable for moving to “level 2”; some for moving all the way to “level 3”. Indeed, there are warning not to use language certain features unless you are working at this highest level: they are just not necessary otherwise.

The writing itself is fluent; there are many annotated code examples; at over 700 pages, the coverage is both broad and deep. If you are moving to a higher level, this book is essential reading. Even it you are writing code only for your own use, there is a lot to learn here about Python and its philosophy, and you will appreciate that it is by no means some “toy” language suitable only for beginners. Python is that rare beast whose clean design makes it easy to learn the basics, and possible to build sophisticated applications and frameworks, and this books helps show how and why.