Learning PHP Design Patterns
G**Z
Perfect Book
It doesn't get any better! This book is the perfect Swiss knife for PHP Engineers.
R**S
A little outdated, disappointing
I've been a PHP developer for about 7 years now, and I was looking for something to help me "level up" my skills. Design patterns are always a fascinating topic because I feel that's one area that I could really use some work. I read all 300+ pages of the book in December 2021. I had a lot of hopes for this book, but unfortunately it failed to meet my expectations, for a number of reasons explained below. I regret purchasing it and spending my time reading it.Out of Date:This is partially my fault, for picking a book published in 2013, but the book uses PHP 5. It's been a few years since I last wrote any serious code for a PHP 5 application, having worked almost exclusively with PHP 7+. I think PHP 8.1 has been released recently, at the time of me writing this. It's important because there have been a lot of new language features that this book can't help you take advantage of when designing patterns, especially the stricter typing features in newer versions of PHP.Code:The code in the book is somewhat contrived. I understand the point is to make the examples simple to make it easier to see the design pattern being used, but overall I still found the code examples lacking. The writer has a habit of declaring private member fields and then only using them as local variables in a single function, constantly over-writing them. It almost seems like there's too much eagerness to apply OOP concepts, when they aren't relevant. To me, this doesn't show a clear understanding of how to use the properties of classes. The author also doesn't use standard naming conventions that I've seen in my day-to-day work when naming classes and interfaces. This makes it a little difficult to remember what each class does. I will admit though that the UML diagrams are very helpful in understanding the relationships between classes.Additionally, all the code is in completely vanilla PHP, without any Composer packages or frameworks like Laravel. This is good because you see the pattern for what it is, but bad in that you don't get the full picture of how to integrate it into modern framework that most PHP devs are probably using.There are also some coding practices that were unexpected like creating interfaces to store database credentials and hardcoding HTML. I wouldn't want anyone doing that in a code base I work in.Writing:Mostly the writing is clear, but there were instances where sentences didn't make sense and I had to read a few times until I gave up trying to discern the meaning. There are some typos in the code as well. On O'Reilly's site, you can find a list of errata for the book, which helps clear things up a little. It is discouraging however that all the errata is user submitted, and in the 8+ years since publication, none of them have been acknowledged officially by the author/publisher.In theory, this book covers an important topic for PHP developers, but it really misses the mark and isn't particularly relevant to me. I think I'll go back to "Head First Design Patterns" (also from O'Reilly). Although that book is in Java, it is explained in such a way that the examples can be re-purposed to many other languages.
D**L
That was a nice bonus. It was my first book dealing with ...
I found it a hidden gem. I am a programming enthusiast with roughly 4 years on/off with php and I understood the examples. If you are not familiar with Design Patterns (as I was) the examples are hard at first. You have to ask a lot of questions.I was not aware of type sniffing. That was a nice bonus.It was my first book dealing with Design Patterns and I feel as though I have gotten a good start. The chapter dealing state patterns alone is worth the price of admission. His starting with a on/off light switch was at once engaging and approachable.I thought it was worth it in the end.
D**S
the book is worth to read if you have time
Not bad book but as it was written: the examples are terrible!!! They are badly selected so you simply do not understand why you do such simple thing that complicated way! If you have no enough experience (at least several years, better 5-10) then you will never understand much of this book. I found couple of interesting ideas which was worth to read whole book.
H**K
Excellent Explanations, not so good examples
I would echo some of the negative reviews that the code examples could be better in that they deviate from today's coding best practices. However, the code is not there to show how to build a web app; the code is there purely to illustrate a concept.I found the book enlightening as the concepts are explained clearly.
L**E
Meandering flow, bad examples
Not only would I like a refund of the purchase price, I'd like for this guy to pay me for the time I've wasted reading this book. He meanders all over the place, with various misspellings and ambiguous references that only further confuse a difficult subject. I don't find any fault with his use of English, a fault which seems almost endemic in the field of Computer Science. But it's like he read an English dictionary and then strung together a bunch of words in an attempt to communicate something.Others have noted that the examples are bad. I'd say they're "bad" in large part because of his weak explanations leading up to them.And yes, I totally agree with another comment that this book makes very little attempt at explaining "why" you'd use certain patterns.This book could have used some proofreading by someone who understands Design Patterns. And someone to fix his interchangeable use of certain named examples -- "Product" and "Project" refer to an interface example, but both are used in the book so it's unclear which he's referring to. That's just one of many examples where he's unclear. And with a subject this difficult, clarity is needed.
J**Y
Excellent buy
Its hard to say you love a book so it only got four stars. However the book has very good concepts and if you are trying to improve you programming it is an excellent buy.
M**E
Used but looks brand new.
The book is so new and fresh. Very good for a used book. It's a great book to move away from functional programming.
H**H
Messy, mixed up with HTML and CSS and other web development issues
Ironically for a PHP resource, this book is hampered by mixing up its code examples with large amounts of HTML, CSS and other content that isn't directly related to the issue at hand. It also spends considerable time describing and explaining this irrelevant content. Inevitably, a lot of the HTML and CSS described in the book is now quite dated. There are better books that look at design patterns through PHP, and of course, better books on design patterns themselves.
T**R
A little disappointed
I am a little disappointed with this book. I guess after "Head First Design Patterns: A Brain-Friendly Guide", this is kind of expected. Most of the examples could have been made better to understand. I would recommend the author(s) of this book to take a closer look at the "Head First Design Patterns: A Brain-Friendly Guide", which is great but based on Java language. That was the reason why I purchased this PHP design patterns book. I knew it was not going to be as good as the "Head First Design Patterns: A Brain-Friendly Guide", but frankly, my expectations were higher. I cannot say that I would recommend this book.
P**L
Good tool for making the move from procedural coding to object oriented design in PHP
I'm only partway through so far, but as a PHP developer who wants to upgrade a legacy codebase from disparate procedural PHP/MySQL pages to a true web application using OOP principles, this has been a good learning tool so far. It has truly helped me 'get' objects/classes/methods/etc whereas other books tell you what they are but the examples don't really hit home. It's pretty theoretical, so gives PHP examples while staying relevant for design patterns in general.
S**R
Great Book!
Your next step after OOP! Great Book!
T**S
bien écrit avec de bons exemples
Je recommande.Bien évidemment, c'est en Anglais mais pour le DEV, c'est facilement compréhensible car les DOCS sont souvent en anglais seulement.Tous les design patterns recensés restent d'actualité malgré la date de publication assez ancienne.
Trustpilot
2 weeks ago
2 months ago