Note: This post is over 13 years old. I was 22 when it was originally posted. I stand by my old posts but bear in mind my opinions may well differ now.

Object Oriented Programming

Posted on: 22 September 2010

When learning the ins and outs of web design, after learning the obligatory HTML and CSS, the next logical step for most is learning a server-side language; the most popular choice being PHP. PHP opens up the possibilities of what can be acheived on a webpage and often bridges the gap between web design and web development for most.

PHP Objects, Patterns & Practise

I began playing with PHP a long time ago, doing simple things like showing the current date, including common header files onto a webpage and processing contact forms. PHP is a language that can be easily picked up and adopted by beginners. But nowadays PHP is considered a powerful language that's up there with the big boys like C++ and Java.

One of the features that I've never spent the time to learn is PHP's powerful object oriented capabilities. I'm aware of the concept since studying Java at University and I've adopted the approach when coding in ActionScript 3.0 for Flash; and it's something I've been meaning to learn for a while. After taking on a particularly badly coded PHP project at work, featuring page upon page of badly coded, repetitive procedural-style PHP, I finally decided to grab a book on the subject of Object Oriented Design. After a bit of researching I ended up buying PHP Objects, Patterns and Practise, a book by Matt Zandstra.

The problem with procedural code is it's very easy to write and for it to work. That's great when you're starting out, or even attempting more complicated things. But as a project gets larger and larger it can get harder and harder to maintain without accumulating vast amounts of code duplication and sooner or later bugs will creep in. It's for this reason an Object Oriented approach to programming is often preferred. The book goes into great detail about the benefit of using this method, and being only 50-or-so pages in, I've still got a lot to learn.

It's gonna be a steep learning curve; I'm already a little confused with the nuts and bolts of using objects and all the theory that comes with it, however I'm excited at the prospect of furthering my programming knowledge and learning an integral part of what programming is all about.

If you're interested in purchasing the book, click on the book above to buy it from Amazon.