How many of you really coding in the OOP style? About OOP: http://en.wikipedia.org/wiki/Object-oriented_programming
I do, though it all depends. If I'm adding functionality to an already existing codebase, I *generally* do what the previous coders have done: if they don't do OO, neither do I. So I guess my answer is 'sometimes, sometimes not...'.
I do aswell, although I have only really been using it for the past 2-3 months so i'm still learning.
I have a slight clue about the concept. Could someone give a "OOP 101", and tell us something about the basic 'objects'? Thanks
Objects are an instance of a class - think of a cookie cutter as your class, and the cookies you cut out as the objects. Personally I dont generally use OO techniques in PHP as I dont see the point! I obviously use OO for real programming where there are benefits for using OO, but I haven't found a convincing use case for OO in PHP projects. OO in ASP.NET and JSP - sure that makes sense; but PHP is just such a quick-and-dirty (and damn slow!) tool with minimal back end integration.
MattD I think you are totally wrong. Php (5.x +) is really OOP and OOP is really important and useful when you are coding serious web applications. I use OOP for most of my projects, and I think it is better than procedural programming as it keeps the code more organized and easier to develop - extend an application with less bugs
The trouble is, I dont think PHP is ready for "serious" web applications yet - if nothing else there is very little interopability with back-end stuff like you get with .net or jsp/j2ee. The only way I see OO of being of use in php is for some simple classes for dealing with changing database engines that you can swap in and out, but its not like you cant do similar things with copy-paste at the moment Maybe some sort of system for dealing with the domain classes too I suppose. Basically I cant see OO being of much significant use when all you are doing is taking values out of a database and showing them on a page.
Looks like we have a debate here Php has no native oop implementations yet, but there are plenty of php classes to integrate DB and many OOP frameworks. I understand the way you see things as a .NET developer (I was one too) but the fact with php is that you get what the manual sais. Not the "hidden" bug that only a guru can tell you on a forum like this (or a bug you find after hours of playing around) In any case I agree that php has a lot of things to do regarding OOP, but still OOP can be helpful in most cases.