Recently I took a look at what goes into phpBB forums. Objects, classes, methods, everything!
At the time, I was trying to integrate the forums and knew nothing about OOP. After an emergency visit to my PHP book, I was able to understand the notation.
But, I still have one vital 3-part question, that applies to all programming, not just PHP.
a) How do I make effective objects, classes, and the like? Because I could declare a new class and fill it with mindless dribble very easily. But, rolling into part b, how do I know what to put into classes?
b ) And, when would I declare a new class and create a new object? I know when, as in the portion of the code, but not when OOP becomes useful.
and, most importantly,
c) WHY? Why would I use objects? From what I can tell, methods and properties are just functions and variables / constants that belong to a specific class.
E.g., how is declaring a bunch of functions, and marking them off with a certain prefix db_myFunction() any worse than $db->myFunction()
This is really something that's been bothering me. I mean, what's the big deal about OOP? I understand the how-to part, but not the why.
PS - As I understand it, all languages have different terminology for the same things (although I'm only familiar with PHP), so sorry if my terms are not what you're used to dealing with.
This post has been edited by skyhawk133: 21 April 2008 - 02:20 PM