Object Oriented Programing (OOP) and Design (OOD)
Moderator: General Moderators
- 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)
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)
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
)
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
-
malcolmboston
- DevNet Resident
- Posts: 1826
- Joined: Tue Nov 18, 2003 1:09 pm
- Location: Middlesbrough, UK
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
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
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
- Buddha443556
- Forum Regular
- Posts: 873
- Joined: Fri Mar 19, 2004 1:51 pm
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.
OOP is a very strict discipline.
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.
Discipline = organised, tight, efficent codeClasses = 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
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
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++)
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++)
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
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.
Discipline = organised, tight, efficent codeClasses = organised, tight, efficent code
OOP is a very strict discipline.
Old timer *coughs*OOP was still an academic discussion when I start programming
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.C with Classes if your old enough to remember
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.my thirty years of experience
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:
I'm just kidding of course
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++.Nothing I do in PHP is complex or big enough to require OOP
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
Cheers