Page 1 of 3
Posted: Tue Nov 02, 2004 4:56 pm
by timvw
Posted: Wed Nov 03, 2004 3:04 am
by McGruff
OOP is hard to understand. Those in the know take it for granted that it's the best way to work and that really seems to put a wasp in the pants of those who don't. Rather than attempt to learn something new, people tend to try to destroy things which they feel threatened by - it's human nature, sadly.
It'll take a while to figure out. Everything you write now will get torn up later but you've got to do that: each time you'll be learning a little bit more about good object design.
I cannot recommend strongly enough that you start unit testing (see sig link below) as soon as possible. It looks like extra work in the beginning but trust me it will save you time in the long run. If you test, debugging time is almost eliminated.
Posted: Wed Nov 03, 2004 10:11 am
by BDKR
McGruff wrote:
OOP is hard to understand. Those in the know take it for granted that it's the best way to work and that really seems to put a wasp in the pants of those who don't. Rather than attempt to learn something new, people tend to try to destroy things which they feel threatened by - it's human nature, sadly.
The person that wrote that rant that is linked too above has a
very good understanding of OO and OOP in particular. If one really reads it, and also makes an effort to digest some of the ranting by Fabian Pascal, and puts it into perspective, they may come away with the feeling that both sides of the fence are being a little extreme shall we say.
The idea of associating behaviour with data is good one. A struct with associated functions you could say. The problem in the eyes of the author of this rant, and Fabian Pascal as well, is that moving OOP into the realm of data storage is a technological step backwards. The basis being (according to my understanding and experience) that a heirchal management of data is inferior to a relational one.
I agree.
Now I don't feel that OO suxor or anything like that. I like it. But there is a point of diminishing returns for everything.
Wow, I haven't been here in a while.
Cheers,
BDKR
Posted: Wed Nov 03, 2004 10:40 am
by Draco_03
Yeah I read a big part, and the guy understood OOP quite well.
And he does make a "lots" of good point.
But since I'm not very skilled, It would be mor ethan welcome to see someone respond to a couple of point he makes about OOP.
Posted: Wed Nov 03, 2004 12:22 pm
by McGruff
Hi BDKR good to see you again.
I respect your opinions but that guy really talks a lot of horse manure about OOP. He'll repeatedly set up straw men to tear down and has obviously got a chip on his shoulder a mile wide. I am genuinely intrigued by the idea that structural programming could match the power of OOP but if the author has any serious point to make it's buried under a mountain of prejudice. One of his "OOP myths" to debunk:
OOP would have prevented Y2K problems.
I really hate this kind of garbage because it encourages common fears about OOP being unecessarily complicated and inefficient. This impedes people's learning progress. It's a good thing that you can jump right into php and spray code all over the place. It's easy to create a functional - albeit unmanagable - website with little experience but, IMO, if you want to program well that means learning to use the most powerful tools available: OOP and unit testing.
Posted: Wed Nov 03, 2004 1:04 pm
by BDKR
McGruff wrote:Hi BDKR good to see you again.
Differences aside, it's cool to see that again too.
McGruff wrote:
...but, IMO, if you want to program well that means learning to use the most powerful tools available: OOP and unit testing.
Can't this also be construed as Rotary Club Boosterism? Are we saying that the only way to created good code is to use OOP? We both know that's not true. OO has gone along way towards dealing with issues in development, but it's also created it's own share of problems.
Now I believe that the author has a rather negative tone, but the idea that the only good paradigm is an OO one can be rated the same, and will be by some. But both ideas are extreme at best and counterproductive. I feel the author is counterproductive in his tone. I feel the same way about Fabian Psacal. I fee the same way about the idea that the only way to write good code is to use OO. It's all counterproductive!
I really feel that OO is awesome, but to extend the paradigm to the point of data management/storage is to take it too far. That is the the true point of what that author is getting at.
From the article:
I would much rather have all these cross-references and relationships in a database, which is a tool specifically designed to manage tons of cross-references and relationships. OOP code looks an awful lot like a raw index and ASCII data dump from the database into a flat file (programming code). I would almost never want to manage bulk data that way, so why would I also want to work with a similar representation in programming code?
Now he is being a little extreme and dramatic here, but older guys that remember the bad old days before relational databases will understand what he's getting at. Relational Database Systems solved a lot of problems that the author see's people returning too when there is an effort to extend a particular OO centric view to data management. There was an effort to deal with these issues (or desires?) within the industry that resulted in the appearance of Object Databases and Object Relational Databases, but uptake of those products has been far less than stellar. Evenstill, many OOP users choose to map data into RDBMS systems without knowledge that the OODBMS systems even exists. This is very bad practice.
So, while the author does have a bit of an inflammatory tone, we need to recognize that the true thrust of what he is saying is that the OO view of programming should not be extended to data management. I agree. I think OOP is awesome, but that's about it. When it comes to managing data, isn't that what the database is for? But then, any paradigm can be extended into areas where it shouldn't be eh?
Posted: Wed Nov 03, 2004 1:13 pm
by McGruff
BDKR wrote:I really feel that OO is awesome, but to extend the paradigm to the point of data management/storage is to take it too far. That is the the true point of what that author is getting at.
He does seem to be saying a lot more than this but, on that point, sure: fair enough.
Posted: Fri Nov 05, 2004 11:19 pm
by lastcraft
HI...
BDKR wrote:So, while the author does have a bit of an inflammatory tone, we need to recognize that the true thrust of what he is saying is that the OO view of programming should not be extended to data management.
I think that this illustrates what McGruff is saying.
OO has absolutely nothing to do with data, it's all about behaviour. The whole idea is "data hiding". That Mr Marston should get these things so horribly confused and then fly off handle about it is very much a straw man argument. From my own exchanges with the guy I get the impression that he got as far as inheritance and ended up in some kind of major mess. He's been ranting about it ever since and is anything but keen to take advice on the issue. The trouble is with a smattering of knowledge, and little OO experience, he adopts the tone that he is burdened with a wisdom of the ancients that us OO bigots are trying to suppress.
The article is often quoted and kind of fun, but should be read with a very large pinch of salt.
yours, Marcus
Posted: Sat Nov 06, 2004 8:11 am
by timvw
lastcraft wrote:
OO has absolutely nothing to do with data, it's all about behaviour. The whole idea is "data hiding".
Imho, OOP is about data AND about manipulating that data.
A nice article on OOP concepts:
http://java.sun.com/docs/books/tutorial ... index.html
The articly clearly mentions the 2 characteristics for an object:
- behaviour (functions)
- state (data)
Imho, both Fabian Pascal and Tony Marston have valid points, but also have an "arrogant" tone of writing and seem to get lost in their own frustrations.
Posted: Sat Nov 06, 2004 11:36 am
by BDKR
I haven't been here in aeons and I come back and get in a tiff!
lastcraft wrote:HI...
BDKR wrote:So, while the author does have a bit of an inflammatory tone, we need to recognize that the true thrust of what he is saying is that the OO view of programming should not be extended to data management.
I think that this illustrates what McGruff is saying.
I'm not too sure where I ever saw or understood McGruff to be saying as much.
In what you quoted, there are two facts. 1) His tone is inflammatory, and 2) OO centric views should not extend to data management. That said, I suspect there is agreement with number 1, but nothing posted indicated agreement or understanding of 2).
lastcraft wrote:
OO has absolutely nothing to do with data, it's all about behaviour. The whole idea is "data hiding".
I am of no particular school as to wether or not it has nothing to do with Data or Data is a very intrinsic part of the OO concept. I personally think if terms of Responsibility (RDD) which may imply that I learn more torwards behaviour.
But my points had nothing to do whith that question anyways.
lastcraft wrote:
That Mr Marston should get these things so horribly confused and then fly off handle about it is very much a straw man argument. From my own exchanges with the guy I get the impression that he got as far as inheritance and ended up in some kind of major mess. He's been ranting about it ever since and is anything but keen to take advice on the issue. The trouble is with a smattering of knowledge, and little OO experience, he adopts the tone that he is burdened with a wisdom of the ancients that us OO bigots are trying to suppress.
The article is often quoted and kind of fun, but should be read with a very large pinch of salt.
Everyone in the world will agree that his tone suxs. Additionally, while there was only one point that I was trying to make, bringing into question his character or knowledge shouldn't have anything to do with it.
Simply put (once again), I agree with the stance of Mr Martson and Fabian Pascal regarding data management (I'm not talking about state here) and OO. That's it! That doesn't mean I'm <span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span> on the OO altar.
Cheers,
BDKR
Posted: Wed Nov 10, 2004 11:01 pm
by lastcraft
Hi...
BDKR wrote:
...bringing into question his character or knowledge shouldn't have anything to do with it.
You are absolutely right of course and my comments should be pulled by the moderator. Apologies for lowering the tone.
BDKR wrote:
That's it! That doesn't mean I'm <span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span> on the OO altar.
<span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span> away

. Actually I agree that the DB is often the place to manage data, although not necessarily a relational one. Full text and LDAP have their places too. On the other hand, I'd much rather write my business logic in an OO language than SQL these days unless that logic is going to be shared across applications in multiple programming languages.
yours, Marcus
Dropping in two cents..
Posted: Wed Nov 10, 2004 11:45 pm
by Roja
< rant >
The one topic I get deeply frustrated about on these forums is OOP.
In dozens of threads, anytime anyone brings up legitimate shortcomings with OOP, the cognoscenti jump in to refute it as if it were a religion under attack in public.
In the case of both Weirdan and McGruff, I frankly get to the point where I have to filter their results completely out just to see a thread that even approaches balanced. I respect both deeply - I just feel that they both have willingly "drank the kool-aid" on OOP, and repeatedly post (quite frequently) in reply to anyone posting that OOP has flaws, or that it isnt the best choice for (insert every programming situation here).
I agree with almost everyone in this thread on one thing: the tone of the link provided is inflammatory.
However, I disagree with most people here that its not justified - OOP is not the holy grail, the alpha and the omega, and it is not for everyone.
Worse, are platitudes like "Thats just not how its done", or "Good programming does X". There are *millions* of lines of highly respected, widely deployed non-oop code out there, and its not "bad programming".
I'm sure I'll take it in the teeth yet again for blashpeming the OOP holy land, but no amount of "Its great because X says so" will change the fact that OOP is not the swiss army knife of programming.
There are flaws, and site regulars would do well to remember that people of opposing views would like to occasionally enter a thread without the repeated almost self-flagellating worship of a programming concept that at best is good for particular situations.
Heck, I'd settle for a few threads where someone said OOP wasn't the best solution (for anything!) *without* seeing an argument from the site regulars.
Telling people they should program with warnings on, or register globals off, those I can see being nearly-universally defended, but OOP? OOP was an afterthought until php-4.1.2.
</ rant >
Posted: Thu Nov 11, 2004 2:16 pm
by McGruff
It's a great thing about php that you can jump right in and start learning to code but programming well means using the most powerful tools available: OOP and unit testing. Once you get a few steps beyond embedded echo calls, you have to start thinking about script design.
If programming in the global scope is one-dimensional, using functions adds a second dimension and OOP is 3D. With each new dimension the power of the language increases exponentially. I've often heard people say that using functions / structural programming is an alternative to OOP but, unless you severely restrict the problems under consideration to very simple tasks, I don't think this holds up.
The big problem for budding php-ers is that, at first glance, OOP looks unecessarily complicated and "inefficient". There's also quite a steep learning curve to get over before you can begin to appreciate why this is not true. It's therefore necessary to make a point of debunking the usual OOP canards when they surface and to encourage people to make the step up. Bad advice impedes people's learning process; good advice helps them move forward. That's where I'm coming from, anyway. This forum is a place to learn how to program well and I'd be selling users short if I didn't do this. Everyone is of course free to argue different points of view.
Incidentally, a big part of the learning hurdle which new coders sometimes miss is that OOP talks more to the programmer rather than to the machine. It doesn't really do anything you couldn't do by other means but it does make code easier to read and maintain. With OOP, you can create entities with rich meaning: abstracting archetypal concepts, encapsulating chunks of related code into discrete, swappable modules, or create a common language between programmer and client.
The article/rant we've been talking about may have been intended to deal with databases but in fact goes well beyond this to make a rather ridiculous attack on OOP. The guy is talking out his as* there and I think it's important to say so. OOP programmers will sigh and think "here we go again". Do we make our own blanket statements? Well yes because, to the best of our knowledge, the earth is round, not flat.
Perhaps we should set up a coding challenge sometime so that we can compare alternative solutions to some defined problems? At some point, we have to start talking real code.
PS: I should apologise to the original poster since it was me who sparked off the OOP "jihaad". I can split this off to a new topic if you'd prefer to get back to discussing your own class designs.
Re: Dropping in two cents..
Posted: Thu Nov 11, 2004 2:23 pm
by Weirdan
Roja wrote:
In the case of both Weirdan and McGruff, I frankly get to the point where I have to filter their results completely out just to see a thread that even approaches balanced. I respect both deeply - I just feel that they both have willingly "drank the kool-aid" on OOP, and repeatedly post (quite frequently) in reply to anyone posting that OOP has flaws, or that it isnt the best choice for (insert every programming situation here).
Objection, Your Honour

I participated:
- in 6 threads where the term 'OOP' was ever used;
- in 11 threads where the term 'object' was ever used;
- in 33 threads where the term 'class' was ever users;
- ... out of 961 threads I ever participated in
Doing simple math: ((6+11+33)/961)*100 = roughly 5% of the threads I was ever seen in mention those OOP terms
Let's move to personal stats. Those terms were used by me:
- 'OOP' - 6 posts;
- 'object' - 11 posts;
- 'class' - 41 posts;
- ... out of total 1413 posts.
~=4% of my posts.
I don't see it as 'quite frequently', keeping in mind that mostly I answered someone's questions.
PS: I never considered myself OOP addict and I was surprised to hear that from you.
Re: Dropping in two cents..
Posted: Thu Nov 11, 2004 5:37 pm
by Roja
Weirdan wrote:
PS: I never considered myself OOP addict and I was surprised to hear that from you.
I was attempting to spread the commentary and mention multiple people. To be fair, I've only seen it from you a few times - and while heavily in support of OOP, it was bearable but combined with other voices, its a chorus of opposition.