`restricted` member variables

forkit forkit at gmail.com
Wed Jun 22 11:36:52 UTC 2022


On Wednesday, 22 June 2022 at 11:12:45 UTC, claptrap wrote:
>
> The problem here is that some people think their idea of OOP is 
> the only valid one. And when people dont agree with them they 
> throw their toys out of the pram.

No. You're confusing terms here.

I'm referring to the way in which D butchers the abstract data 
type concept, by refusing to allow an 'option', so that a class 
can actually be one.

You do not need to be doing OOP, to benefit from abstract data 
types.

Of course, this butchering does have an effect on OOP in D. But 
that's not the main point here.

In fact, you are always using abstract data types, and 
benefitting from them, regardless of what 'paradigm' you're using.

i.e. you cannot put "wtf" into an int.

again, the benefits of the abstract data type is well known.

here's a lesson, for those that just don't seem to get it:

" [imagine a ]string type that guarantees that it will be 
immutable only if its clients promise not to change it. Then 
you’d have to check all the places in the code where the string 
might be used."

http://web.mit.edu/6.005/www/fa14/classes/08-abstract-data-types/



More information about the Digitalmars-d mailing list