Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

codenihal's avatar

PHP Design Patterns: An Introduction

Hi Guys, Just wanted to let you know here at the forum that I'm publishing my first Leanpub book called PHP Design Patterns: An Introduction, https://leanpub.com/designpatternsphp/ .

Just take a look at it and tell me how I could improve.

0 likes
20 replies
keevitaja's avatar

Hi,

there is not much sample content to review...

And cover image is stupid-stupid large. About 12 MB!

1 like
claudiu's avatar

hello,

I will ask you here also, on reddit/r/php you have not answer. :) Why I should read this book? Is php-centric book, as in design pattern in ruby( http://www.amazon.com/Design-Patterns-Ruby-Russ-Olsen/dp/0321490452 ) or, just let's write a book and become famous.

  • is this book in relation with GoF book?
  • is this book special for php issues and problems
  • is this book a best practice with php and design patterns
  • will this book provide me values as
  • objects in rails
  • gof book
  • poodr book

and last: what is your experience in the programming world? with abs no offence ;)

my 2 cents

xingfucoder's avatar

I'm reading the downloaded document from the link and I'm waiting for the rest of it :) to evaluate the buy.

Would be possible to get the TOC of the ebook for get knowledge all topics will be covered?

Thanks in advanced.

Great work!

codenihal's avatar

@keevitaja The Cover Image was a pretty quick piece of work, so didn't have time to work on it much. I will fix it later tonight. Check the landing page, its only 25 % complete. I published it early because I didn't want to be caught in an overload of problems later.

codenihal's avatar

@claudiu The Book will be a catalog of Design Patterns explained as simple as I possibly can.

It will have content on Laravel and its implementation of the the Patterns as an additional Appendix.

As to the questions :

  • is this book in relation with GoF book?

-> In the sense that it is focused on a language and its issues and problems. YES

  • is this book special for php issues and problems

-> Yes.

  • is this book a best practice with php and design patterns

-> Yes

  • will this book provide me values as, objects in rails, gof book,poodr book

-> This is not an OOP book. Its a Design Patterns book. as to the gof book, I believe that the writers are far more experienced than me or at least I hope so, since I bought 2 of them. ;). A basic idea of OOP is necessary. AS to the values, we will be covering SOLID and the rest. and throw in some stuff here and there.

  • what is your experience in the programming world?

-> I have been a web developer for the past 6 years and recently started my company, Paradigm Shift. I am a Laravel Evangelist. I am 14, if thats not a disqualification. I love my work. and no offence taken.

codenihal's avatar

@claudiu I did not make the mistake of assuming that mine is the best resource. I added this stuff and the tutsplus article to the bibliography as some of their expressions and metaphors were very succinct. We will be covering most of the design patterns in a simple, easy to understand order.

Thanks for stopping by to comment and for the feedback, I will be updating the cover image and once again, thanks.

keevitaja's avatar

Looking forward to review it again once you have bit more content available!

codenihal's avatar

Ok, what did you think about the chapter in the sample?

keevitaja's avatar

Can't really comment on a adapter pattern as i have not been using it myself.

Though i have one small note. I do not think using ORM in your example is good idea. As this book might be red by beginners, they might not be familiar with it.

I suggest you make a small class that does something, like feeds a dog (lol), and go from there.

claudiu's avatar

@nsnihalsahu.code so you are 14 years old, and you are doing professional programing for 6. Well done!! I'm an old 30 years old, doing professional programming for 12 years now. I' was reading you'r book sample, and you blog post and you look that your a junior developer with not so much exp. But that fact that you'r only 14 year old and you write code is impressive. I do not want to cut your wings and dreams. (As I do in my current company with all juniors that apply design patterns anywhere and talk half a day about scaling ).

Also, I finish psychology beside CS, and I want to ask you: - how was at 12 to write code? Was for fun for joy? (I'm asking you that because I was doing programming from school and hate it:). I just want to chase girls and play football all day)

keevitaja's avatar

14 and 6 years of dev experience? Started at eight? I do not say it is not true, i know similar, well almost similar, case myself, but this is insane. Usually 8 year old kids still learn 10 times 20.

Also english is not your native language?

codenihal's avatar

@keevitaja The ORM was meant to be mistaken by beginners as pseudocode. Pretty simple right.

@claudiu I understand that Design Patterns are not appropriate everywhere. I spend every chapter stressing that , and giving examples of wrong usages. and code was always, always fun for me.

@keevitaja It is true, started with tutsplus and sadly w3schools since 8 years ago. But started professionally 6 years ago. And english is not my native language, but I learnt it before I learn't any other language

keevitaja's avatar

Design Patterns are not appropriate everywhere

I do not think this is valid. Design patterns are not something that people come up with to share but rather what people are doing.

Once a coder reaches certain level of experience he starts doing the patterns which make most sense and sometimes the coder does not have to know even, that something he does is a well used pattern.

codenihal's avatar

@claudiu I forgot everything about it except the name a long time.

@keevitaja I meant it in the sense that, there are situations when the strategy pattern is not appropriate or you just need not go to the trouble of doing the factory pattern just because you can when you have a better, simpler way.Any about the last line, I almost seemed to say the exact same thing in the intro of my book.

@keevitaja codebabes is not really for 8 year olds

JeffreyWay's avatar

It's amazing that you're writing a book like this at such a young age. Just make sure that you have a firm grasp of these design patterns first. :)

1 like

Please or to participate in this conversation.