![]() |
is OOP a thinking style?
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.
|
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.
|
Being lazy is a virtue of a programmer. =P
|
Quote:
|
It means being a lazy Programmer is good like me :p as I don't really make much applications but I do :]
|
The question really doesn't make sense. OOP is a part of PHP just like arrays or functions.
|
Quote:
OOP is a concept, rather than a built in function of PHP. Object-oriented programming - Wikipedia, the free encyclopedia 8-) |
I am well aware of what OOP is (knowing php,C++, some java and some C#), but he is asking a question specific to PHP. I see how my post can be misread though.
As it is a concept, they had to build it into PHP. |
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. |
| All times are GMT. The time now is 03:29 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0