|
Actually it does happen in the real world, the defects are carried through the dna.
If your cat is screwed up, then its likely that its descendents will be screwed up. I think your holding to to strict of an interpretation. And the argument is still weak that object orientation isn't valuable in our virtual world.
The Grand Negus wrote: This is not the case when, for example, your program screws up a DLL that my program is sharing, etc.
That can only happen if my program recompiles the dll. Give me a break. Sheesh.
The Grand Negus wrote: Another reason that it works in real life is that plants and animals are living beings that do things on their own; most programs are more like tools that are used to do things - the procedural paradigm is more appropriate in these cases.
This is your opinion. And not necessarily shared by all. To make a blanket statement of authority isn't valid in this case.
This statement was never false.
|
|
|
|
|
|
We were discussing inheritance, not library linking. I statically link my dlls. In C++ I'd statically link the MFC dll. So, I wasn't prone to that. Only in the case of some third party dlls for imaging did I have to deal with it, and then I deployed the dll locally so any overwrites didn't effect me.
The Grand Negus wrote: It's not my personal opinion
It is your personal opinion that procedural programming is the better fit.
The Grand Negus wrote: If you can't (or won't) see that, then once again, I can't help you.
Why do you insist that I need help with this. We disagree on the value of object oriented architectures. Apparently I can see beauty there where you don't. I can also see beauty in procedural programming, but its a case by case basis. In fact, for true encapsulation you need a mix. The algorithms should be seperated from the data when possible. So, whatever. Sounds like Josh was correct that you are always coming from a perspective of guiding the youngling to your truth. And for the record, I'm 38. So, now you can condescend as to my lack of experience compared to yours within this physical episode.
This statement was never false.
|
|
|
|
|
The Grand Negus wrote: Granted. But (in my mind) the two are examples of a similar mistake. There's a significant practical difference, in both method and result, between a programmer who (a) extends an existing class hierarchy to make a new program, and one who (b) copies some existing code, deletes what he doesn't want, and adds in his new stuff. The question, then, from a biological point of view is this: when God makes dogs of both the poodle and the collie variety, are His methods closer to (a) or (b)?
A. Extends the dog class with variations that stem far back in the tree. This is where overloading as opposed to overriding would come into place (b). You would for the methods that you wish to dispose of, overload the method with either a new one, or an empty one.
And, as you say, in your mind. Again, we're getting back to opinion. I really think that a blended approach holds more value than either one standing alone.
The Grand Negus wrote: I'm saying it's an all-but-obvious conclusion that most logical thinkers would share.
Which is still your opinion.
The Grand Negus wrote: That doesn't sound very object-oriented!
Actually it is. Read some literature on the developments of the paradigm. Of course, I would expect this response since you look to be biased against it.
The Grand Negus wrote: Yes; that, currently, is both my mission and my goal. See my profile here; I make no bones about it.
Well, in this case, we have a differing opinion on the merits of object oriented architectures. That's it. So, I don't see how you can lead me to the light here, since I find value in both procedural and object oriented approaches. This position you hold could very well be blinding you, you know?
The Grand Negus wrote: Thanks for the info, but it doesn't change much. I already knew you weren't suffering from the "arrogance of youth"!
Fair enough.
This statement was never false.
|
|
|
|
|
The Grand Negus wrote: In any case, from a human programmer perspective, (b) is a significantly easier approach because you have to keep much less in your head; things are what they are, period.
Not in my experience and this is precisely why I endorse an object oriented architecture. I've found value in it.
The Grand Negus wrote: Developments of a paradigm that deny the basic tenents of the original paradigm are not developments at all - they are admissions that the original paradigm was simply wrong, which has been my contention since the object oriented approach was invented and popularized by biologist/programmer "everything is an object" Alan Kay. I've lived through this kind of thing once already: the apparent advantage of hierarchical and network databases that fail to live up to their promise and eventually disappear in the light of the simpler relational model.
The basic tenents of the original was fledgling at best. And it was misunderstood in my opinion to mean that encapsulation includes every possible operation. For this reason the string comparison methods for CString in MFC are outside the class structure. Just procedural methods.
I don't agree that everything is an object, and that's been one of my objections with C# and .NET is that they take that approach, albeit catering to the needs of some procedural through the introduction of static classes, which are really just object like containers of procedural functions.
You won't win this argument with me, as its too subjective. I enjoy architecting with objects. I truly enjoy it.
The Grand Negus wrote:
I might think so if I didn't from time to time re-visit the alternative approaches to see if I had missed something. So far - after several of these re-visits - I still see very little benefit (and much unnecessary confusion) in the object-oriented approach. Really. I've coded the same non-trivial applications both ways and the object-oriented approach adds nothing but unnecessarily complexity and more machinery. See, for example, the discussion under point (2) in this[^] thread.
And that's certainly valid for how your mind works when designing systems. My mind works better with a blend of object architecture and procedural. Each does have a place.
This statement was never false.
|
|
|
|
|
|
As far as i can tell, the difference between a Procedural program and an object, is that Procedural sub programs have a single Method entrance with a large parameter list / block and internal branching, wheras an object can expose properties and a number of methods depending on the requirements, so the branching would occur on the level above.
Procedural Program - A set of methods with a central repsitory of values.
Object - A Set of methods with a central repository of values.
As for re-using code by copying functions, you're still fixing something that isn't broke, and an object that already works, works.
If someone changes your Sub Programs, and it breaks, you're still stuck with the same problem as someone breaking your Dll, so it's kind of a moot point. Software is software, in many ways it compares to real life, but it is still a non tangiable platform and the information age caveats apply.
The Grand Negus wrote: This is exactly what I mean by unnecessary complexity. First, they adopt a "pure" object approach and then, when they can see that it isn't quite working, they add something to simulate what they already had before they went with the objects. Schlepps.
I think that's the wrong way round, they static members came first, then objects.
That's just my two cents, but then.... What would i know.
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
The Grand Negus wrote: Not in the "pure" object approach invented and popularized by Alan Kay. His first pronouncement on the subject being: "Everything is an object."
A key component, maybe the component, of object oriented programming for Alan Kay was message passing. Keeping that in mind, let's look at your oven example:
The Grand Negus wrote: The difference is that the procedural approach separates data and process: nouns over there, verbs over here. Cookies there, ovens there, baking something that the (implied) cook does with cookies and ovens here.
The object approach makes the processes part of the data: methods inside objects. Cookies there, ovens there, baking a method inside the cookie which somehow bakes itself. Or maybe inside the oven. Who knows? And what happened to the cook?
Well, my take on that would be that the aforementioned objects would send messages to each other. So we have an Oven that takes a Cookie. The Cookie is placed in the Oven by a Cook. The Cook sends a message to the Oven to bake at 350 degrees for 30 minutes. The Oven sends messages to the Cookie so that it changes as a result of the baking. When the Oven is done, it sends a message to the Cook that it is finished baking. And so on...
If I were implementing this in C#, I'd create an interface representing anything that can be baked; the Cookie class would implement this interface. That way the Oven doesn't have to know it's baking a Cookie, just that it has a "bakeable" object that it can send messages to.
|
|
|
|
|
And that is the problem in a nutshell. You are too focused on the english correlation to the code. I don't think about nouns and verbs. Never liked my English class. So, the moment you force me to focus on English you've lost me.
The Grand Negus wrote: An animal is a thing...
A cat is an animal with...
A dog is an animal with...
To pet a cat...
To feed a dog...
To bake an animal in an oven...
Frankly that is just too much to supply.
And the elipsis implies that the definition is incomplete.
I really don't liken to the concept of programming in this fashion.
How do you reuse code?
How do you take the definitions supplied in one program and make them available to other programs. Code reuse is a biggie. I for one, will not take on a language where I need to define everything everytime.
This statement was never false.
|
|
|
|
|
I drop the assembly in the directory I'm using. Once built I don't need to cut and paste.
This statement was never false.
|
|
|
|
|
The Grand Negus wrote:
I'm a Telecaster man myself, but I won't deny that there's virtue resident in the Humbucking pickup device...
Only if you have the option of a coil tap.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete O`Hanlon wrote: Only if you have the option of a coil tap.
One of my Les Paul's has that option. The Black Beauty pickups let you switch back and forth between single coil and double coil. I won't claim it sounds like a strat or tele in single coil mode, but it does sound sweet.
Will get back to this thread later time allowing...
|
|
|
|
|
Leslie Sanford wrote: One of my Les Paul's has that option.
Sweet.
I've always wanted to go more Les Paul, but having come from a Van Halen/Vai rock type background - I've always ended up buying guitars with Floyd Rose style trems. Mind you, as I'm getting older (and a bit more mellow), perhaps it's time for me to experiment with a fuller sound.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Well, I don't see it this way. I'm not a purist. It doesn't have to be exactly right the first time. Not only in design, and development of code, but also in design and development of paradigms its an iterative process. I'm not gonna choose to throw the baby out with the bathwater here.
Like I said before, which you seem to be selectively leaving out of the discussion is that I personally prefer a blended approach and don't see this as competition between procedural and object orientation, but rather as complimenting themes to be used where useful.
So, I enjoy the current wave. I'm productive in it, and can think fluidly when designing a system.
This statement was never false.
|
|
|
|
|
The Grand Negus wrote: And since I use my tools, in essence telling them what I want them to do, it isn't a big leap to the conclusion that the procedural approach is a better fit when working with tool-like objects.
No sell. Software is a better match to the machines that we build using tools. Therefore how we use tools is not germane to your "procedural" point. Software is more comparable with an automobile or an aircraft carrier than tools. You are just wrong... as usual.
led mike
|
|
|
|
|
|
The Grand Negus wrote: Your definition of "tool" is too narrow
No, you are ignoring that those are machines. Machines are used by people as are tools but they are vastly different of course. Ignore it if you like but then you have the resultant flawed analysis and bad decisions based on it as a consequence.
led mike
|
|
|
|
|
|
The Grand Negus wrote: I stand by my original argument: living beings do things by and for themselves; artifacts (tools, machines, etc) are used by humans as an aid to the accomplishment of an end.
that's your original argument? Whatever... I quoted what I was replying to, here is another:
The Grand Negus wrote: most programs are more like tools that are used to do things - the procedural paradigm is more appropriate in these cases.
you are just wrong, period.
led mike
|
|
|
|
|
led mike wrote: The Grand Negus wrote:
most programs are more like tools that are used to do things - the procedural paradigm is more appropriate in these cases.
He seems to think that because humans use a procedural approach to using a tool, that it follows a tool should be coded, and follow, the same procedural method. Not so IMHO.
This approach may be true for simple tasks for programs to follow, but OOP developed out of the need to develop more complex tools.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
|
The Grand Negus wrote: And that a paradigm that pictures a word processor as a tool is more likely to succeed than a paradigm that see a word processor as some kind of plant or animal.
It is a tool. The problem is that you're not looking deep enough into the word processor. As with any tool, say an electric drill, it's made up of parts that interact with each other in very specific ways to accomplish a function of the drill. Some parts are interchangable with other drills to modify their function in some way.
Animals and plants are built the same way. Out of many smaller pieces that interact in specific ways to give a more complex organism life and various functionalities.
The adaptability of humans is a testament to such a concept. Human's weren't made with wings, so they couldn't fly. Add the classes called MetalWings and a class derived from IThrust and you've enhanced the abilities of the Human class so he/she can fly, and you done it without modifying the code for Human.
Your argument is flawed because you're ignoring the fact that all tools are made up of smaller pieces, that, individually, are interchangable and couldn't do any part of the task the tool was designed for by itself. The interaction of objects is what provides the functionality, not the objects themselves.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
The Grand Negus wrote: Actually, OOP developed out of biologist/programmer Alan Kay's notion that programs are like living beings, their "objects" like living cells.
They are. They are also like tools as you suggest and Machines as I stated, they are also like a pair of shoes or a bar of soap... so what?! There are many things that programs are "like" but you are trying to limit them to being "exactly" like a hammer and therefore we should only think of them from that perspective.
Perhaps the software you have experience with is more like a hammer than an Aircraft carrier but that is not my experience and therefore you are never going to convince me, and I hope not many others either.
led mike
|
|
|
|
|
The Grand Negus wrote:
Actually, OOP developed out of biologist/programmer Alan Kay's notion that programs are like living beings, their "objects" like living cells. That is the notion I'm arguing against.
Maybe its conception. But not its adoption. Its adoption is pretty wide spread wouldn't you say? I say that's because it effectively solved some complex design requirements fairly elegantly.
This statement was never false.
|
|
|
|
|
I don't think its profitable to force what we do into these narrow terms.
And what difference would it make to consider them as tools or machines.
But I think a valid point is missed. Take the automobile for instance. You can take the brakes and use them with one auto or another. Parts are interchangeable. An engine is a complete object consisting of other objects. It has input and output. But, it is an object. Not a function. Its action is a function of those objects' interactions. In this case, I'd like to put my 350 from my Blazer and drop it into my Jeep. A few other objects and viola! I can do it. I liken software to this. The assemblage of parts.
Looking at the human being. The liver is an object. It performs a function. That function is encapsulated. Taking the heart for instance, we've even been able to supplant the human heart with it, and acheive the desired functioning irrespective of the host object. Human or pig.
Procedurally this can't happen. Only with objects. In your world maybe the only objects are the concepts of modules and routines and sub-routines.
This statement was never false.
|
|
|
|
|