Shoulder of giants
Tuesday, February 01, 2005
Today, I found a blog entry called Why Quantum Theory is important for Object Orientation
Interesting stuff - Once read, you can't unread it. I, also like to put different (seemingly unrelated) things together and see how it turns out - Read Software Engineering and dogs
Anyway, if you have 5 minutes to waste, read on...
Back to quantumifying Object Oriented theory: objects, per se, never exist, and are really an abstraction of an idea that lives as long as there electrons flowing on some piece of silicon, nothing more. On the other hand, a particle "exists," (in the sense that we think of existence) and then becomes reality as needed. So, I don't see any parallels between Quantum and OO.
OO, is not a near perfect theory, nor any type of law claiming to predict the success of any project. OO is nothing more than the logical growth of older software building practices (Structure or Classical Software Engineering): we started with chaotic processes and we ended up with "fake" controlled chaotic processes. We don't know if they are correct, however, something is better than nothing and we seem to have some success using OO and a few other techniques.
There is no magic, the power of OO comes from the realization that we can break things into well defined abstract representation of whatever domain we are representing. I.e. A window, a ball, a bank account, etc, etc. So, once the abstraction is defined, we can forget about its implementation and we can just reuse it to do our bidding in a larger system - Noting, that an object in OO theory is nothing more than an instance of an Abstract Data Type that supports inheritance - This is hardly a new idea - It's been around since the 60s.
I do agree with the fact that both theories try to make sense of larger systems, however, OO is probably not a good proponent to solve the real problem we have with engineering software: mainly its complexity and, what I call, factorial explosion. I.e. Millions of 0s and 1s put together to form binary strings, which in turn represent the state of a binary machine in RAM and in some storage medium (most computers, now a days).
OOP will not died out. OO, however, will likely evolve into something better - Perhaps Aspect Oriented Programming or perhaps to something else with a catchy name and acronym that will become the new "new thing."
The evolution of any process is only an indication that we are doing something wrong and it must be improved, or the process has outgrown its need. Either we modify the process, or stop using it all together. Structure development practices, is such a process - If we need reusable components, we better start thinking of how to design and reuse those components and OO lends itself to such task: we don't separate data and behaviour, as we used to do with Structure programming styles.
Quantum Theory, on the other hand will be either proved, or disproved - No two ways about it - It can only be improved by finding truth, via the human concoction of abstract thinking that we call Mathematics - With Mathematics, we are able to prove, or at least predict certain phenomena in our "physical" world: we can predict how much energy we will get out of a photon hitting a sheet of metal (Einstein). We can calculate how fast the space shuttle needs to go, in order to escape the Earth's gravitational field (Newton). We will see a dead cat, when the look directly at it (Schrödinger). We indeed, stand on the shoulders of giants. Perhaps, now a days we don't stand on their shoulders, we more or less read their blogs and pass the word around.
So, using physics and the scientific method we are able to predict physical phenomena. When we discuss software systems, it is an entirely different proposition. I don't believe we will ever be able to predict, to the nearest second, when the last line of code will be typed; nor that we will not have touch the source code any more, as it is perfect when we are done with it and solves the problem we want to solve - Never say never, but, I think my prediction will stand for a few decades to come.
What if we think of code as long strings of 0s and 1s, that form executable binaries.
Imagine, if you will, that we are able to dictate our requirements in human language, and with the use of some generating function and some statistics, we are be able to predict the most common states of all those 0s and 1s (to a high degree of reliability) - Then any OOP would not be useful at all, as we would only be dealing with the factorial combinations - Similar to DNA: all those As and Gs do make a human being - In our case, all the combinations would yield a perfect program.
I think it is fair to say, that if we ever (society as whole), figure out quantum theory, then we will also solve the software engineering problem - I mean, we can build quantum machines with quantum based RAM and quantum based CPUs, which are probably going to be limitless in terms of storage capacity and raw CPU power - If a program fails, it will be able to fix itself, recompile itself, and restart itself, all at the same time - If not, then quantum physics was wrong :)
Thanx for commenting my entry about Quantum Theory. I agree with you, that particles can be seen as "existent" and that a technical object (instantiated from a class, which be seen as a prototype) does not exist in our common sense.
But more important is the concept behind working with objects. Firstly that you accept and define an object as a first class entity. Secondly that you handle an object as an atomic unit (atomic is not quite correct as an atom is not an undividable entity, but was meant to be and seen as one, earlier). Thirdly, as you write, objects in OO are abstractions; and objects in physics are abstractions as well, there is no difference.
I think, the difficulty understanding the similarities and analogies between the two concepts/paradigms/theories (name it as you like) is that we still think there is a ("one") reality. That is wrong, from what we know today. When thinking in concepts and not in characteristics of things being describes, it should come clear which parallels one can draw between OO and QT (except their abbreviations both consist of tweo characters).
> Firstly that you accept and define
> an object as a first class entity
Well, we could argue that an object is also like the atom: an object, in order to be of any use, must be composed of other objects - In our case, fields. Java, got around this chicken and egg dilema by introducing a "super" object or mother of all objects: the "Object" object. Anyway, I don't think we can consider an object as first class entity.
> and objects in physics are abstractions
> as well, there is no difference.
I think there is a difference. Mainly, that when we talk about physics, we are not only talking about the abstract models, but, rather of the actual phisical existence of the matter composing the physical object and how everything else around it, affects the behaviour and state of such object. Including relativitiy, quantum chemistry, etc, etc.
If we look at the scientific method, one of the main characteristic is the definition of a repeatable, and predictable abstract model. I.e. F = m x g, always. Of course this is an approximation, as if we really think about it, the mass of an object CANNOT be constant - There is too much going on at the molecular level and anything (Including a minor change in temperature) affects the actuall mass.
On the other hand, an "object" in the sense of OO, it is truly an abstract representation in definition and in existance. I.e. it only lives in silicon and it only exist in the context of the problem - It's like information: a message is only a message, when decoded by a receiver, properly; otherwise, it only becomes noise. A more specific example: a bank account object is meaningless, if I'm talking about a representation of a hurricane in a computer simulation.
So, I still don't see a parallel :)
As per our "real" reality, I think we have an approximation of it, and for all intent and purposes is good enough. I.e. I drink water, therefore I'm no longer thirsty - Is real enough, that I accept all the axioms that go with the action of drinking water, as true and whenever that reality represents itself as real - At least that what the current Quantum theory proposes. As per Quantum theory, the momen Mathematics proves, or disproves, it will be accepted as the truth of the day.
As per OO theory, I can only think of it as the evolution of an older process that needed and upgrade.