Python is a well-designed language. If you have not already tried it, I would highly recommend it. I have been reading a lot of books related to python. “Pythonic Programming” has been on my list to read and I finally got a chance to read it.
In this book review, I’ll be sharing my thoughts on “Pythonic Programming” by Dmitry Zinoviev.
Summary of the book:
“Pythonic Programming” is a comprehensive guide to writing Python code that is readable, efficient, and maintainable. The book covers wide range of topics, including Python syntax, tips, and performance optimization.
“Pythonic Programming” is structured into five sections with numbered tips which contain brief explanations about a particular tip. Each tip contains tidbits about particular python syntax e.g. single tuple. This book contains of a total of 100 tips which is great. This book attempts to uncover some of the best practices in python however failed to do.
In nutshell, this book is not very good in structure and content. Although I really this kind of book where the author writes “Traps” of languages. I wish more writers can write the same kind of book for other programming languages. Knowing “traps” in the language is a very huge advantage when developing in the real world.
This book attempts to write better python idiomatically but it fails to do so. It was a disappointing reading however there are some good tips and takeways:
- Tip 7 : Self-Document Your Code
- Tip 12 : Avoid “Magic” Values
- Tip 12 : Enumerate Your Constants
- Tip 20 : Embrace Comprehensions
- Tip 22 : Find the “Missing” Switch
- Tip 27 : Discover All Characters in One Place
- Tip 38 : Treat Your Code as a Module
- Tip 42 : Count with defaultdict
- Tip 51 : Return Consistently
- Tip 53 : Return Many Values
- Tip 54 : Understand Optional and Keyword Parameters
- Tip 61 : Time It
- Tip 80 : Let Python Close Your Files
- Tip 83 : Use Properties
Overall this book does not offer much, however you can read it once if you have some time.