I've been coding in PHP for about 6 years now - always used a basic "script-like" approach. Recently I've begun to make things object based and I don't think I'll ever go back. You get so much more structure and it's easier to "feel" your program.
For example, if I have a list of clients and products in a database and want to print out all the relations, I could just query the database and echo out a table...OR...I could create client objects, then create product objects, then assign those products to the clients...then I really feel like I have structure, rather than just a random list of crap.
For simple tasks it's overkill, but in larger applications it's worth it. Much easier to understand in the end and easier to modify.
|