Opinions on object oriented programming

BlitzMax Forums/BlitzMax Programming/Opinions on object oriented programming

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I've been reading up about many kinds of object oriented implementations, not just BlitzMax's implementation or C++, also looking at Self and Smalltalk and the concepts in general. This: http://www.objectfaq.com/oofaq2/ is a good site for explaining things although some terminology is a little unnecessarily heady. *click on the `Basics` button*

There seems to be a number of often subtle differences between how each language implements object orientation and what features are provided. I liked the sound of `1-dimensional` object-orientation where any object can be a parent to any other object, and you have delegates to choose different parents, rather than having `classes`. So the inheritance is more dynamic. This is closer to what I think of as a highly flexible paradigm. I was also reading up about multiple inheritance and multiple polymorphism. Strange solutions to preconception-induced problems.

I do have some issues with how all this works and its limits. I don't like the imposition of a hierarchical structure as being the only way for objects to become associated through inheritance. All objects should be completely freely associating with any other. Also those relationships shouldn't be described in terms of superiority or inferiority - all are equal. There may be contracts or associations but none of this super/parent/child stuff.

I also feel that while it's all very well defining parts of problems or parts of the world in terms of `objects`, where an object is basically any aspect of a problem that is tangible enough to be described, this limits communication to only occuring across boundaries rather than the presence of `direct` understanding. Such communication is interpretation, not `knowing`. Objects should be able to metamorphose fully or in part with other objects to effectively share data and functionality and to temporarily extend any object's repertoir. I think it's wrong to think of things in terms of objects and more powerful to think of them in terms of `mediums` - mediums are always open and are never fixed. Mediums allow objects to transcend themselves and their limitations.

Also I don't think I believe in encapsulation where you hide stuff behind a stubborn controlling interface. In this model you have to more or less `ask` an object to do something. This is all very polite and socially acceptable but to socialize means `social-lies`. Two people in love do not usually have to ask each other at every turn whether something is okay. There is an openness and trust. I think encapsulation is a closed-minded model. There is no intimacy in having to access objects through interfaces. Interfaces get in the way. That's like having to write a note to your partner asking if it's okay to kiss them.

Objects should be able to resonate with one another to an absolute degree, optionally of course, so that they effectively become `one` and then one object can operate the other or operate `through` the other or together. Also one object can then be like a merged pool of objects, able to operate on all it is aligned with directly and immediately without any need for message passing. To me, extra message passing indicates poor design.

I also think there is still too much of the roots of procedural programming still left in object-oriented programming. It's one step up but not all the way up. It's kind of like procedural programming chopped up into smaller pieces and extra infrastructure to manage the pieces.

I think the best paradigm would be where each part is a reflection of the whole - where the whole is an instance of the part - ie `made in the image of` - holographic. In this system any single object can be the whole system or part of a system. Also any single object needs to be sophisticated enough to interact with all others and not just in predetermined ways. In fact, the ideal system needs to support subjectivity.

So those are a few of the areas that I have issues with and am seeking to address with a new kind of programming paradigm.