SJS wrote:
> begin  quoting David Brown as of Sat, Mar 22, 2008 at 12:33:15AM -0700:
>> On Sat, Mar 22, 2008 at 12:22:55AM -0700, [EMAIL PROTECTED] wrote:
>>
>>> IMHO the essense of OOP is organizing related functions and data into
>>> distinct units.  We call these data-function blobs "objects".
>> Actually, that almost entirely misses the point of OOP.  I would call that
>> more something like modular programming or structured programming.
>  
> Um, no, that's the key and the crux.
> 
> Yes, it's very like modular or structured programming. 
> 
> The difference is that (in OOP) if my code is handed a data structure, 
> the behavior is available... I don't have to find the function that knows
> how to handle THAT data structure. It's there "in the object".

So, would you define Modula-2 as OOP then? ;-)

>> There are several aspects that are important to OOP, all of which can be
>> done independently, but people tend to bundle them together and call it
>> OOP:
> 
> Mostly people list their favorite language features, regardless if
> whether or not it is necessary.

Mostly people tend to pretend they invented the term and are the
authority on what is and isn't meant by OOP. ;-)

>>   - data or structure inheritance.  Allowing subtypes that contain the
>>     fields of parent types with possible additional fields added.
> 
> And then there are languages like Self that don't have classes, and
> thus no "inheritance"...

Well, some people think classes are essential to OOP (obviously not the
Self folks). People have crazy notions.

>>   - Dynamic dispatch.  Probably the most important part.  Allows calls to
>>     be generalized 
> 
> C++ uses static dispatch by default, doesn't it?

It is not really relevant what the default is in some language, other
than perhaps for some notion of how "strongly" a language is OO.

> If you write a C++
> program and never define a virtual function, is your code necessarily
> not OO then?

Well, let's just say that not every C++ program could be considered OO. :-)

But we're confusing notions of object oriented languages vs. object
oriented *programming*. One can do OOP with C or assembly if one likes to.

> "Features of many OO languages" != "Features of OOP".

In general, OOP isn't defined by "features".

--Chris

-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to