Object Oriented Programing (OOP) and Design (OOD)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Object Oriented Programing (OOP) and Design (OOD)

Never heard of it.
0
No votes
I know very little about OOP and have a negative opinion of it.
0
No votes
I know very little about OOP and have a positive opinion of it.
2
7%
I have used OOP a little and have a negative opinion of it.
0
No votes
I have used OOP a little and have a positive opinion of it.
3
10%
I mix Procedural and OOP and have a negative opinion of OOP.
1
3%
I mix Procedural and OOP and have a positive opinion of OOP.
11
37%
I mostly use OOP and have a negative opinion of it.
0
No votes
I mostly use OOP and have a positive opinion of it.
11
37%
I use OOP like Martin Fowler does.
2
7%
 
Total votes: 30

User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Object Oriented Programing (OOP) and Design (OOD)

Post by Christopher »

After all the discussions about programming methologies in PHP, and Object Oriented Programming (OOP) in particular, I thought I would ask what people's attitudes are. I am not interested here in the merits of one methodology over another (though I doubt I can stop the comments), just what people's feelings are positive or negatve, broken down by their experience with it.
(#10850)
Ree
Forum Regular
Posts: 592
Joined: Fri Jun 10, 2005 1:43 am
Location: LT

Post by Ree »

OOP all the way and still learning. Couldn't/Wouldn't program in any other way.
User avatar
R4000
Forum Contributor
Posts: 168
Joined: Wed Mar 08, 2006 12:50 pm
Location: Cambridge, United Kingdom

Post by R4000 »

i love my OOP :)

i use it all the time now xD
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

Apart from examples i haven't seen Martin Fowler write much code so i can't compare.

When i'm confronted with a problem i always try to divide this problem in smaller problems. I iterate that proces until the problems are small enough so i can solve them. Usually i end up with OO code but that code isn't the goal itself. It just seems to be the best solution i can come up with at that given time for the specific problem.


(A couple of weeks i quickly hacked a wordpress plugin together. Afterwards i tried to discover the general behaviour of such a plugin and translated that into a class. As soon as my requirements change, or modifications are required, i'll let you know which version was the easies to change ;))
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

Anyone else read the poll and start wondering what Eastenders has to do with OOP?

Just me I guess..
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

ive movedover to classes almost exclusively now, i believe when your in the industry we're in, then when a client is paying you for work, you want to give him/her the most professional work, not just output but source code as well.

Classes = organised, tight, efficent code

my $0.02 anyway, search my posts from this time last year and i didnt have a clue what OOP was, its really not that hard to learn and is a vital asset to any programmer
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

My spider sense is tingling, so I'm reminding you all this is not a debate between OOP and Procedural. Carry on :D
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

onion2k wrote:Anyone else read the poll and start wondering what Eastenders has to do with OOP?

Just me I guess..
I really don't see much difference between here and here (if you turn either photo over they are same guy! ;)).

FYI - to Eastenders OOP means "Oi Ou! P***off!"
(#10850)
User avatar
Buddha443556
Forum Regular
Posts: 873
Joined: Fri Mar 19, 2004 1:51 pm

Post by Buddha443556 »

OOP was still an academic discussion when I start programming. Most of my OOP experience has been in C, C++ (C with Classes if your old enough to remember), Java and Perl. I have developed a healthy positive respect for OOP, OOD and OOA from my thirty years of experience. However, it takes a rather complex problem for me to resort to OOP or a substantial hourly wage. If it's big enough to require OOP then it's too big for this solo developer.

Nothing I do in PHP is complex or big enough to require OOP but OO principles do sneak into my problem solving in PHP, which is unavoidable. :wink:
Classes = organised, tight, efficent code
Discipline = organised, tight, efficent code

OOP is a very strict discipline.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

I am not saying anything in regards to the subject, but I will say: That's a very thorough list you have to select from, good job!!! :)
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

I have recently (past few months) been doing OOP and I like it. It's easier to seperate your code and it makes sence. I just am not that good at it so ya...
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

Martin Fowler writes code? ;)
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Way too many useful design patterns in OOP for me to not use it. It just "feels" right too.

For all that PHP did not natively support OOP I actually like the way it all works in PHP5... granted, namespaces would give it more of an edge.

I also use OOP in JavaScript and C++ (n00b level for me in C++) :)
dreamline
Forum Contributor
Posts: 158
Joined: Fri May 28, 2004 2:37 am

Post by dreamline »

Well, i've started OOP about 5 months ago, before that I never saw the use of OOP, but now I can't do without. Makes things so much more structured... :)

So thumbs up for OOP, I wish I started using it 18 months ago.. :D
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

Buddha443556 wrote:OOP was still an academic discussion when I start programming. Most of my OOP experience has been in C, C++ (C with Classes if your old enough to remember), Java and Perl. I have developed a healthy positive respect for OOP, OOD and OOA from my thirty years of experience. However, it takes a rather complex problem for me to resort to OOP or a substantial hourly wage. If it's big enough to require OOP then it's too big for this solo developer.

Nothing I do in PHP is complex or big enough to require OOP but OO principles do sneak into my problem solving in PHP, which is unavoidable. :wink:
Classes = organised, tight, efficent code
Discipline = organised, tight, efficent code

OOP is a very strict discipline.
OOP was still an academic discussion when I start programming
Old timer *coughs* :P

C with Classes if your old enough to remember
Well I'm 27 as of March 19th this year...and although I don't remember C++ being just C with classes, I've read in a few books (Thinking in C++ By: Bruce Eckel) that many hardcore C programmers, when making the transition to OOP with C++ have treated it that way.
my thirty years of experience
And here I thought, at least in the PHP community (being such a young language, easy to learn and appealing to a much wider audience) I would be a veteran - part of the reason I switched. :)

I started developing a long time ago...about 3/4 of my life has been spent learning langauges and technologies, but alas, I still don't hold a candle to your 30 years...

Booo...go back to your old school languages which were used to develop software on machines with vacume tubes and computer bugs looked like this:

Image

:P

I'm just kidding of course :)
Nothing I do in PHP is complex or big enough to require OOP
I thought that way to when I started in PHP...for me it was a C++ ego thing more than anything...I figured if it needs OOP I might as well do it in C++.

I've since changed my mind...and although PHP's object model is far from perfect - like really far...I still enjoy writing classes for scripts.

p.s-You wouldn't happen to be a member of the http://www.codeproject.com community would you? If you still develop in C++, especially in VC++ thats the ultimate resource and community, something 2 million members. Some amazing talent...I've been truely humbled by a few guys on there - either directly through argument (being proven wrong - which never happens :P ) or indirectly by reading an amazing article...

Cheers :)
Post Reply