June 22, 2022
On Wednesday, 22 June 2022 at 09:33:53 UTC, forkit wrote:
>

and..

" the final, and perhaps most important, property of a good abstract data type is that it preserves its own invariants."

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



June 22, 2022
On Wednesday, 22 June 2022 at 08:06:10 UTC, forkit wrote:
> On Wednesday, 22 June 2022 at 08:00:41 UTC, claptrap wrote:
>>
>> ...
>
> see. i knew there were some anti-OOP in the D community.
>
> thanks for the 'data' ;-)

Concerns about OOP not only in the D-community.. I believe it is the new trend in the last couple of years.
For example, chapter Criticism here:

 https://en.m.wikipedia.org/wiki/Object-oriented_programming
June 22, 2022

On Wednesday, 22 June 2022 at 08:16:26 UTC, Ola Fosheim Grøstad wrote:

>

It is useful when building your model. That is too obvious a point to argue: Start out by making everything maximally constrained, then loosen up (reluctantly) when you have no other option.

  1. Nobody does that.
  2. If you dont know up front 99% of what needs to be private or public then you probably ought to give up programming and take up flipping burgers.
June 22, 2022
On Wednesday, 22 June 2022 at 10:42:00 UTC, Sergey wrote:
>
> Concerns about OOP not only in the D-community.. I believe it is the new trend in the last couple of years.
> For example, chapter Criticism here:
>
>  https://en.m.wikipedia.org/wiki/Object-oriented_programming

The OO 'paradigm' has been *heavily* critised ever since the term first became used.

Any yet, it's one of the most succesful paradigm's to date, having been responsible for some of the biggest software engineering projects in the world.

But I'm not for or against any particular paradigm. They all have pros and cons, and are suitable for this situation, and not particulary suitable in some other situation...

I prefer multiparadigm actually.

But I do believe first and foremost, in using abstract data types, wherever possible - without any regard to a particular 'paradigm'.

And I don't means D's interpretation of one (i.e. one that **cannot** declare its own invariants, let alone enforce them).

I mean the one defined all the way back in 1974, by Liskov and Zilles.

https://dl.acm.org/doi/pdf/10.1145/942572.807045


June 22, 2022
On Wednesday, 22 June 2022 at 10:42:00 UTC, Sergey wrote:
> On Wednesday, 22 June 2022 at 08:06:10 UTC, forkit wrote:
>> On Wednesday, 22 June 2022 at 08:00:41 UTC, claptrap wrote:
>>>
>>> ...
>>
>> see. i knew there were some anti-OOP in the D community.
>>
>> thanks for the 'data' ;-)
>
> Concerns about OOP not only in the D-community.. I believe it is the new trend in the last couple of years.
> For example, chapter Criticism here:
>
>  https://en.m.wikipedia.org/wiki/Object-oriented_programming

Its Javas fault, it popularised "everything is an object" to the point where it seemed like OOP was touted as the solution to everything.

Its not but it an extremely useful tool in a lot of situations.

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.
June 22, 2022

On Wednesday, 22 June 2022 at 11:01:27 UTC, claptrap wrote:

>

On Wednesday, 22 June 2022 at 08:16:26 UTC, Ola Fosheim Grøstad wrote:

>

It is useful when building your model. That is too obvious a point to argue: Start out by making everything maximally constrained, then loosen up (reluctantly) when you have no other option.

  1. Nobody does that.

Wrong.

June 22, 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.

The problem here is that some people have a poor understanding of modelling, implementation and evolution.

D's problem is that this affects D at every level from the compiler implementation, to libraries and language evolution.

But encapsulation is not the biggest fish to fry at this moment, so it is a waste of time at this point.

June 22, 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/

June 22, 2022

On Wednesday, 22 June 2022 at 11:36:52 UTC, forkit wrote:

>

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.

Yes, yes, yes, but many D programmers don't have formal training so they are going by what they read on blogs or their own experience.

It should be obvious to anyone that if D's strength is to go from prototyping to shippable products then solid support for evolution is needed. Fine grained encapsulation is absolutely an advantage. That's 100% undeniable. Especially in system level programming.

However, if I were to rank what should be focused on, then changing/adding to encapsulation would be at spot 20 or so…

Currently the big issue for D is not loosing focus and complete what has been started on:

  1. competitive memory management
  2. @safe and @trusted
  3. completing existing features
  4. fixing error handling
  5. fixing contracts

When all that is done… by all means, look at encapsulation, syntax, etc.

But I would predict that the end result, after everyone has added/changed their pet peeve, would be something that would not be D2, it would be D3.

So the best option is to either make do with naming-conventions to get ad-hoc class-privacy or implement it as a fork.

If you want to do this in a fork then I'll try to help you with locating the spots that need modification. If you complete this on a fork, I'll help you write the DIP for it.

June 22, 2022

On Wednesday, 22 June 2022 at 11:23:47 UTC, Ola Fosheim Grøstad wrote:

>

On Wednesday, 22 June 2022 at 11:01:27 UTC, claptrap wrote:

>

On Wednesday, 22 June 2022 at 08:16:26 UTC, Ola Fosheim Grøstad wrote:

>

It is useful when building your model. That is too obvious a point to argue: Start out by making everything maximally constrained, then loosen up (reluctantly) when you have no other option.

  1. Nobody does that.

Wrong.

What do you mean by "maximally constrained"?