View Single Post
  #19 (permalink)  
Old 06-24-03, 02:59 AM
Pineapple Pineapple is offline
Newbie Coder
 
Join Date: Jun 2003
Location: Phoenix, AZ
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally posted by gizmoitus
Realistically most of the benefits one gets from OOP in an OOP language like Delphi, C++ or Java aren't available in the current very limited OOP available in PHP. It's no surprise then, that they have announced a complete overhaul of the PHP's oop constructs in a future release.

I still tend to use classes for organizational purposes, but there's no compelling reason to do so other than to gain a bit of organization.

One of the most important benefits of true OOP is inheritance, yet you rarely ever see anyone taking the time to derive classes from a base class in php. I think this pretty much speaks to the usefulness of php's OOP.
I definitely wouldn't say "most" of the benefits aren't available to PHP. Even with its limited OOP support you would be probably be surprised still at the difference between procedural and object-oriented programming in PHP.

Inheritance is definitely an important benefit, and PHP supports it. If there are programmers not taking the time to derive classes from a base class in PHP, that is not PHP's problem. I do it all the time myself.

If all you're getting is better organization by using PHP's OOP you're hardly using it properly. I totally agree that many great OOP features are missing from PHP but you can do more with it than you seem to be willing to admit. At least take advantage of the encapsulation. Yes we would all love to see exception handling, interfaces, real constructors and destructors, private and protected members, and such, but don't totally write off PHP's OOP.
Reply With Quote