View Full Version : OOP - worth learning

12-02-2003, 06:54 PM
Can anyone quicly sum up the good and bad points of OOP, i'cve been coding PHP for ages but i've never really looked into it and i'm wondering if it's worth learning/using?

Any links to relevant resources would be nice too


12-02-2003, 11:19 PM
OOP is basically a concept to structure and model your code. Some key features often mentionend are polymorphism, inheritence and encapsulation. So now I answered your question by introducing new keywords. ;) But a short explanation what they mean can be found on "the" wiki:

An extensive list of links is this one:

I can only speak for myself, but by doing OOP, I find the code I produce much more thought out, and easier to reuse. Also easier to test and to debug. But the conceptual level on which you work with objects is significantly higher and more demanding than just hacking a procedural script together. You can learn the syntax of using objects in two weeks, but really doing good OOP with the required object-oriented analysis and design will take you much much longer.

The hardest thing isn't actually the programming part, it's about the analysis, to find the objects your code actually should use, and to describe the communication between them. It takes a while until one has those "aha" effects and really understands an elegant solution of someone else.