2

I've been tied to several procedural applications written in PHP over the past 10 years. Two of these are going away soon, and I need to get up to speed with OOP techniques.

Are there good tutorials or books written for people who are skilled procedural coders? By skilled, I use functions heavily, and classify functions via different include files. I like clean, easy to follow code (and document accordingly). My brain has been trained to think procedurally, though experience taught me to break down code into re-usable parts (easier to maintain and update). I understand OOP is based around the same idea, but I need some help overcoming the hurdle of learning this new (to me) technique.

a coder
  • 31
  • 1
  • duplicated.. and search google – dynamic Jun 29 '11 at 15:18
  • I searched again. Saw many oop vs. proc articles, none really dealing with my question. Did finally see this: http://stackoverflow.com/questions/3747352/getting-out-of-a-procedural-mindset – a coder Jun 29 '11 at 15:22

4 Answers4

2

I was in the same situation and I started to use a CodeIgniter. It naturally guided me into oop (and I LOVE it).

...so by using the CI tutorials I personnaly think you can reach your goals.

hth

1

Perhaps you should look at 'PHP Objects, Patterns and Practise' by Matt Zandstra, 3rd Edition. I actually dislike the writing style of the book; it introduces difficult concepts in a hard-to-digest manner and then expects you to be forever comfortable with them when discussing the books' later material. Nonetheless, with some work, it will certainly help take you far beyond the ubiquitous example of a Shape base class being extended by 'Triangle' and 'Square' children (etc). It is aimed at procedural PHP programmers, so it may be very useful for you.

Martin Fowler's 'Patterns of Enterprise Application Architecture' is also given high esteem although it demonstrates its code examples in Java and I have never read it myself.

pb149
  • 2,298
  • 1
  • 22
  • 30
0

I've never read it myself but I've heard that Head First Java is a good book to learn OOP principles and might be helpful to you http://www.amazon.com/Head-First-Java-Kathy-Sierra/dp/0596009208

  • On second thought, this looks like it might be targeted to new programmers a little too much rather than someone at your level... –  Jun 29 '11 at 15:35
0

This book should be good for you http://www.amazon.com/Object-Oriented-Analysis-Design-Applications-2nd/dp/0805353402 (I've read only the first edition).

I'd advise you to keep away from php-specific books and online tutorials, because most of them are sheer rubbish.

user187291
  • 53,363
  • 19
  • 95
  • 127