Clean Code in Python - Second Edition: Develop maintainable and efficient code
M**N
I’m a software engineer and I’m not particularly impressed
This book does have some interesting sections but I wouldn’t recommend it to either new programmers or people with more experience. It jumps between saying phrases like “but we won’t get into that in this book” and then drills down into some other minutia a few pages later. Some of the examples are helpful but others have logical errors or are unnecessarily complicated. Overall, you could find better information on YouTube or Stack Overflow for free. I was hoping this book would be a more cohesive guide than those options but it wasn’t.
A**R
Lots of interesting information -- but poorly worded and confusing in places
I have a few years of Python under my belt, and I'm definitely learning new things from this book. However, in places, I found the writing to be confusing -- long, unnecessarily bloated sentences with ambiguous pronouns (lots of "it" where it's not always clear to me what "it" is referring to). The book would benefit greatly from rigorous editing. Overall seems worth the effort.
R**E
Tour deforce as to what one needs to consider when it comes to writing clean code
Full disclosure. I was provided a copy of the book by Packt for free and in return, I promised that I would create a review on Amazon. Please note that the publisher did not put any stipulations on the review. In other words, I did not have to provide a positive review.The book is a tour deforce as to what one needs to consider when it comes to writing clean code. It begins by stating that there is no sole or strict definition for clean code. It goes on to say that tools like linters help but that there is no way to create a formal measurement for clean code.It explains that this is because programming is not about communicating with machines but that it is about communicating ideas to other developers. In other words, clean code is like pornography, you know it when you see it.The tour de force covers standard topics like inheritance in detail. The discussion of inheritance begins with the standard warning that each time that a sub-class is manifested, tight coupling is also created. Remember that coupling is a yucky thing.The book provides two questions to help determine whether or not the inheritance design is appropriate. The first question asks whether or not all inherited methods are used? The second question asks how many methods are overridden? If you are not using all the methods and are overriding many methods, it is probably a design mistake.After you have determined that you probably have a design mistake, it talks about some of the potential causes. For example, a superclass may be vaguely defined and contain too much responsibility. This in turn enables corrective action.The preceding generalities are then concretized by using http.server from the Python Standard Library as an example of when to use inheritance. Afterward, the book provides anti-patterns.It doesn't stop there, it then goes on to cover multiple inheritance. It begins by explaining why Python does not have the diamond problem. The diamond problem is the usual standard reason for not using multiple inheritance.Mixins are the last topic related to inheritance that is covered. Mixins are demonstrated using a parser that takes a string and provides iteration over it by values separated with hyphens. This functionality is implemented via a BaseTokenizer. The next level of complexity is that want values to be in the upper case. One solution is to just create a new class. In this case, you can't do that because a lot of classes are already extending BaseTokenizer and don't want to impact them. The solution is to create UpperIterableMixin and then use multiple inheritance to create Tokenizer(UpperIterable, BaseTokenizer).Other topics related to clean code are covered in just as much depth. That is why the book is 423 pages long.Like anything in real life, the book is not perfect. The goal of the book is clean code. However, it spends time in minutia like an entire section titled "Delegating into smaller coroutines – the 'yield from' syntax". The other side of this is that it ignores topics in Python like multiprocessing and subprocess. However, these are just minor warts because nothing is ever perfect.The bottom line is that the cost of the book will pay itself the first time that you apply any of its concepts. A book, with editors and tech reviewers, ensures high-quality content. When you look at blogs on the internet, you never know what you will get.The other advantage of a book is its table of contents. It will quickly limit the number of items that have to look at as well as providing a structure for those items. When you Google, how many blogs will you have to look at before finding what you need and determining its quality?Again, let me emphasize that the investment in the book is well worth it.faThe Bit Plumber
R**D
This book is super instructive
** I got this book as part of a $5 sale on Packt to be transparent **I plan on reading this book again a bit later because the information I was able to extract from it has already benefited me in the workplace. One cool thing is that the information isn't just reserved to Python but also software development and software engineering principles.I think the format (i.e. the way the information presented) is well done as well, often times I see something I don't understand and the author rushes in to explain what's going which is greatly appreciated. However this isn't without it's faults, as another reviewer mentioned the book could use some editing in certain places where the words chosen may seem a bit convoluted and other times unclear.The impact of this isn't too detrimental but still it left me with some question marks about what the author wanted to say on certain pages. Hopefully a second read would clear those up however.I already recommended the book to some of my colleagues as well at my job.
G**I
Excellent book
A very good book for writing clean code in python. It is a must buy for python developers.
G**.
Worth the money!
Good print quality, good paper quality, and the contents are perfect for a mid to advanced python coders. Covers wide range of topics with examples.
C**N
Yes there is a table of contents and index in the Kindle edition
Just a point of information, to correct someone's earlier complaint. I bought the Kindle edition just now and it has a detailed table of contents that links you directly to the relevant sections, as well as a pretty detailed-looking index too.I almost didn't buy the Kindle edition, on account of the misleading review. So, maybe the review applied to an earlier edition (quite possible), in which case it should not appear for this edition.Dear readers, feel free to get the Kindle version. It's fine.
O**R
Zu oberflächlich
Das Buch ist zu oberflächlich geschrieben. Einfache Beispiele fehlen.
J**Y
Read this book to be better using python
Well written with excellant examples. This book will help you be a better python developer. Not for a complete beginner
Trustpilot
2 months ago
5 days ago