d future or plans for d3
Timon Gehr
timon.gehr at gmx.ch
Tue Dec 20 10:17:39 PST 2011
On 12/20/2011 06:41 PM, Jonathan M Davis wrote:
> On Tuesday, December 20, 2011 17:58:30 Timon Gehr wrote:
>> On 12/20/2011 05:36 PM, Jonathan M Davis wrote:
>>> On Tuesday, December 20, 2011 15:49:34 Timon Gehr wrote:
>>>> 2. Dynamic binding is a core concept of OOP. A language that does not
>>>> support dynamic binding does not support OOP. A program that does not
>>>> use dynamic binding is not object oriented. What is to disagree with?
>>>
>>> I don't agree with that either. You don't need polymorphism for OOP.
>>> It's
>>> quite restricted without it, but you can still program with objects even
>>> if you're restricted to something like D's structs, so you're still
>>> doing OOP.
>>>
>>> - Jonathan M Davis
>>
>> No. That is glorified procedural style. 'Objects' as in 'OOP' carry data
>> and _behavior_, structs don't (except if you give them some function
>> pointers, but that is just implementing poor man's polymorphism.)
>>
>> Having some kind of dynamic execution model is a requirement for OOP.
>> There are no two ways about it.
>
> Well, I completely disagree. The core of OOP is encapsulating the data within
> an object
Yes, encapsulation is another core concept of OOP.
> and having functions associated with the object itself which operate
> on that data.
Correct. The functions have to be associated with _the object itself_.
Case closed.
> It's about encapsulation and tying the functions to the type.
Static typing is not an OOP concept.
> Polymorphism is a nice bonus, but it's not required.
It is not a bonus. It is part of what OOP is about.
>
> I'd say that any language which is really trying to do OOP should definitely
> have polymorphism or it's going to have pretty sucky OOP, but it can still
> have OOP.
>
In case you define OOP differently from all relevant textbooks, based
only on the encapsulation aspect, yes.
More information about the Digitalmars-d
mailing list