I don't know what I am asking really... I guess, do you think PHP is a way of thinking? Such as, instead of making a 'program', you are making a 'society' of communicating functions. I ask this because I have been avoiding OOP until I get good at other things, and I am not sure if thats a good idea.
The Following User Says Thank You to Aaron For This Useful Post:
Well yes kinda, OOP is a different thinking style, as in you do have to put a little more thought into application design and how methods and such are all handled. Just like any other coding task, time and practice just gets you thinking differently about it, which eventually makes you quicker (developed a 'thinking style' for it ?) idc.
Definitely need to make sure you have the basics down though before trying to dive into OO concepts.
Good luck :)
.... i guess it would depend on the language as well, some languages like Java and C-Sharp (C#) are based entirely on OO concepts, so an understanding of OOP would technically be required for certain langs =D
OOP is indeed a different way of thinking, you develop your application as a series of objects. Its a good idea to have a good knowlege of your language before you do OOP, but there isnt any harm in trying its not like its gonna explode or anything, just have a play around.
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)
OOP is a programming paradigm which is "a fundamental style of programming regarding how solutions to problems are to be formulated in a programming language." (from Wikipedia)
Different paradigms provide different approaches to solving problems; for example, OOP looks to thinking of a program as a collection of objects which can interact with one another. Your own analogy of seeing a program as a "society" of communicating functions (objects) is a start towards thinking in an object-oriented way.
If you really want to delve into what OOP is all about, my first suggestion will always be to forget trying to 'learn' OOP with specific regards to any individual programming language (PHP). Instead, it is important to grasp the wider, overarching principles at work without getting bogged down by language syntax. Even better, learn OOP as part of a wider understanding of the other available programming paradigms which are just as useful tools in a programmer's arsenal.
Rather the simply answer is, you've gotta really LEARN OOP as it is. It's surely a thinking style. The functions are way more advanced than the simple, built in functions. PHP4 uses simply expressions like 'var' and 5 uses 'public', 'private', 'restricted' and more.
First time I tried OOP, it took about 2 days to really get into it and when you stop scripting OOP-style, you once again got to pick up the thread.