Subject: to C3 participants
> If you don't mind I'd like to ask about C3 project. We have
> [been discussing] OOP and FP. The question is why C3 project
> was implemented using object-oriented programming, not [...]
> functional programming. There [are] two opinions:
> 1. The complexity of software today is bigger problem than the
> problem of concrete algorithm implementation, so OO the way
> that help to overpass this complexity.
> 2. The opposite opinion.
I wasn't involved in the C3 project. But in 1987, when I joined EDS
(owned by GM) I learned about Object Oriented and Functional
programming at about the same time, while in the EDS training program
for their research department. (We were also looking at AI
techniques, such as neural networks and rule-based expert systems.)
Personally, I found OO to be more appropriate than functional because
of the way that OO puts code "close" to the data it manipulates, and
gives a small set of functions ("methods") *complete control* over
that data. So if you want to change the data representation, it's
much easier to determine which functions ("methods") might need to
Consider a "Polygon:"
Let's do Functional Programming in LISP:
. (...a "Functional style" subset of LISP usage.)
I can pass around a list of points, each of which has an 'x' and a 'y'
coordinate. Let's consider this simple data representation:
((0 0) (10 0) (10 10) (0 10))
[It's a 10 by 10 square: 4 points, with the first one at the origin.
Technically it's a list of 4 elements, each of which contains a list
of 2 elements, and each of those elements is a number.]
Unless I add some layers of metadata and abstraction, every function
that manipulates the points of the polygon pretty much has to know
things like "The FIRST element is 'x' and the SECOND 'y'." There's no
particular place (like a class) where assumptions are isolated.
"Points" have no real identity; it's all just generic data.
With an Object Oriented approach, one could create a "Polygon" class
and ask it questions like, "Is 'new Point(5,5)' inside this Polygon?"
You can do *A LOT* with Polygons without knowing anything about their
internal representation. With polymorphism, you could even be working
with many "polygon-like" objects, like Circles, which have a
dramatically different data representation (like center Point and
The Object Oriented approach is very good at simulation. And it turns
out that simulation is a very useful technique for solving problems in
a number of domains, such as business data processing.
[No offense intended to LISP: You can do both Functional and Object
Oriented with LISP. And it's one of the most powerful languages in