Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Events
Videos
Audiobooks
Packt Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds

Free eBook - Clean Code in Python - Second Edition

4.6 (34 reviews total)
By Mariano Anaya
  • A new free eBook every day on the latest in tech
  • 30 permanently free eBooks from our core tech library
  1. Introduction, Code Formatting, and Tools
About this book
Experienced professionals in every field face several instances of disorganization, poor readability, and testability due to unstructured code. This second edition has been updated to reflect new best practices in Python 3.9, helping developers write professional, scalable, and maintainable code. It introduces advanced object-oriented design, decorators, descriptors, and refactoring strategies using SOLID principles. Whether modernizing legacy projects or building new applications, this book provides practical techniques to write cleaner and more efficient Python code using the Python standard library and manage your projects successfully. The book begins by describing the basic elements of writing clean code and how it plays a key role in Python programming. The book discusses object-oriented programming in Python and show you the design principles of software testing and how to resolve problems by implementing software design patterns in your code. In the concluding chapter, we break down a monolithic application into a microservices-based one starting from the code as the basis for a solid platform. By the end of this clean code book, you will be proficient in applying industry-approved coding practices to design clean, sustainable, and readable real-world Python code.
Publication date:
January 2021
Publisher
Packt
Pages
422
ISBN
9781800560215

About the Author
  • Mariano Anaya

    Mariano Anaya is a software engineer who spends most of his time creating software with Python and mentoring fellow programmers. Mariano's principal areas of interest besides Python are software architecture, functional programming, distributed systems, and speaking at conferences. He was a speaker at Euro Python 2016 and 2017. To know more about him, you can refer to his GitHub account with the username rmariano. His speakerdeck username is rmariano.

    Browse publications by this author
Latest Reviews (34 reviews total)
It's easy to write code and even quite easy to write it so it looks pretty, but is it readable by others? This book does help with that i.e. write code so it's clear for others to read and understand, but it also guides the reader into writing code using best practices for the Python language itself whether that be optimising memory usage or minimising the chances of errors. Keeping code simple, while allowing complex things to be done.Anyone using Python whether a beginner or veteran will get some useful knowledge from the book and improve how they write code and how it works.
This is such a good book to level up your skills. This would be a great resource for beginners as it will teach them great coding principles for the start.Even for intermediate Python developers, this book has such a great wealth of information.It's going to take me a while to chew on all the knowledge that Mario Anaya offers.My goal was to write better code and I've picked up several tips from this book -- keep an eye out for the insights inside the light bulb boxes!!This is a great resource in my journey to write cleaner idiomatic code.
Lots of good information in this book on best practices for Python software engineering as well as general software engineering, this book could definitely form the basis for a software engineering or related class in a university. I think it is useful to anyone with at least 6 months of substantial Python experience (e.g. you've coded in Python several times a week for at least 6 months). Ideally, you should have done at least one big Python project under your belt.Overall it's very well-written, and it follows a good logical progression of simple to complex ideas. But as one other reviewer said, it's extremely dense with information. It takes a lot of concentration to read through the material because of this. This is good in my opinion, but be prepared to take breaks throughout reading it to catch your mental breath.There an error in the book I already caught and I assume more. Looks like it could've used more proofreading. The first error I found is the first example of documentation in the book on page 11: it's supposed to show the docs for the update function of dicts but only shows the last line. In my experience, Packt doesn't always do thorough enough proofreading and errors like this tend to show up in their books. So if something seems confusing in the book, be aware that it may be due to an error. I didn't catch any other errors so far but have only thoroughly read the first half of the first chapter, and skimmed the rest.
Recommended For You
Expert Python Programming - Fourth Edition

Attain a deep understanding of building, maintaining, packaging, and shipping robust Python applications

By Michał Jaworski and 1 more
Python Data Cleaning Cookbook

Discover how to describe your data in detail, identify data issues, and find out how to solve them using commonly used techniques and tips and tricks

By Michael Walker
Data Engineering with Python

Build, monitor, and manage real-time data pipelines to create data engineering infrastructure efficiently using open-source Apache projects

By Paul Crickard
Mastering Python for Networking and Security - Second Edition

Tackle security and networking issues using Python libraries such as Nmap, requests, asyncio, and scapy

By José Manuel Ortega