By CodeJustin
via artima.com
Published: Nov 16 2009 / 12:02
I am an atypical programmer, since I spent most of my career doing science, not programming. When I first learned about Object Oriented Programming, a little bit more than seven years ago, I compared it with my experience in Mathematics and Physics. I was puzzled. In Mathematics you have objects (consider for instance the elements of a Lie group) but the objects themselves are not important: the important entities are the relations about the objects, their properties. When I write a + b in a mathematical expression I am not really interested in the objects: a and b may be numbers, or matrices, or functions, or oven operators in a Hilbert space if I am doing Quantum Mechanics: in any case, the important thing is the addition operation. The + means that I am performing a commutative operation and therefore that the objects I am using are part of a commutative group and a set of well know properties are valid for them. Translated into programming jargon, that idea means exactly that the important things are the interfaces, i.e. the set of operations/methods which are available to the objects, not the objects themselves. Actually, the details about what the objects really are can be disregarded as implementation artifacts and I can write generic code which works for all objects satisfying a known interface, just as in Mathematics I can write a single proof valid for the entire class of entities satisfying a given set of properties.



Add your comment