June 12, 2022

On Sunday, 12 June 2022 at 00:41:20 UTC, norm wrote:
D is so flexible and

>

very good at so many things that people are unwilling to accept that D by design just doesn't do everything the way they want.

Do you know why c++ is cool? C++ provides tools. I can use them as I like.

D limits me!

June 12, 2022

On Sunday, 12 June 2022 at 00:41:20 UTC, norm wrote:

>

In a practical sense module scope encapsulation works really well, I find it much better than strict class encapsulation that then has to be broken anyway with friends.

Unless it's very special, I don't need c++'s friend.

June 12, 2022
On Sunday, 12 June 2022 at 00:41:20 UTC, norm wrote:
>
> ... It is fascinating the amount of energy in D forums spent talking about D's shortcomings and reminds me of the internet in the late 90's early 00's where every forum chat ended in a flame war.
>
> All this energy would be much better spent making software with D or building up its ecosystem....but that requires work and not as much fun as pointing out someone is wrong on the internet. The latter requires no work at all for the same physiological response in the brain as recognition by others for a job well done.
>

Actually, 'the latter' as you call it, takes a LOT of work .. its exhausting ;-)

The 'flaming' as you call it, usually results from the passive-aggressive types always coming out of the woodwork...and they use all kinds of diversionary tactics to shutdown your argument:

https://medium.com/the-mission/5-tactics-used-by-passive-aggressive-arguers-and-the-best-forms-of-defense-42a9348b60ed

My argument could not be simpler:

Compiler. please enforce the invariants of my class at compile time, if that's what I ask you to do (with, for example, 'scope private int x';

It's a really, really, really, really, simple proposition.

June 12, 2022

On Sunday, 12 June 2022 at 01:02:21 UTC, zjh wrote:

>

Unless it's very special, I don't need c++'s friend.

But c++ give friend. You can have it if you want .If you don't want it, forget it.
D is not .
D force you to have a bunch of friends .
They are not friends, they are enemies!

June 12, 2022

On Sunday, 12 June 2022 at 01:04:55 UTC, zjh wrote:

>

D is not .
D force you to have a bunch of friends .
They are not friends, they are enemies!

Just like several outsiders in your family misuse your things without permission every day.
Do you think he is your friend?

June 12, 2022

On Saturday, 11 June 2022 at 18:59:42 UTC, Ola Fosheim Grøstad wrote:

> >

Or talking about Simula, which doesn't have a mechanism for encapsulation.

C++, Java and D follows Simula. Simula's protection levels were added in the 70s: hidden, protected and hidden protected, but the defining characteristics is class inheritance, virtual functions and coroutines.

I didn't know those had been added. If it had them from the start, would that make encapsulation another defining characteristic?

June 12, 2022

On Sunday, 12 June 2022 at 09:30:06 UTC, Max Samukha wrote:

>

I didn't know those had been added. If it had them from the start, would that make encapsulation another defining characteristic?

Many OO languages don't provide encapsulation, like Python. I would say encapsulation has more to do with scaling up and evolving, as well as reliability (e.g. actors). But I guess you can say that OO features span a space where encapsulation is one dimension.

June 12, 2022

On Sunday, 12 June 2022 at 09:54:42 UTC, Ola Fosheim Grøstad wrote:

>

Many OO languages don't provide encapsulation, like Python.

Right, but Python programmers are expected to prepend private members with '_'.

>

I would say encapsulation has more to do with scaling up and evolving, as well as reliability (e.g. actors).
But I guess you can say that OO features span a space where encapsulation is one dimension.

Then it is natural to expect the feature would apply to the class level (if we are talking about class-based OOP)? Really, I'm yet to meet a D user that wouldn't be surprised 'private' is module-level. And the 'friend' story rarely impresses them. The reply is always: "Ok, 'friend' breaks OOP principles. Is D better because it breaks OOP in its own way?"

June 12, 2022
On Sunday, 12 June 2022 at 01:03:06 UTC, forkit wrote:
> My argument could not be simpler:
>
> Compiler. please enforce the invariants of my class at compile time, if that's what I ask you to do (with, for example, 'scope private int x';
>
> It's a really, really, really, really, simple proposition.

Why not prepare well written DIP with examples from other languages and to ask some experienced core developer to have a look at it?
June 12, 2022

On Sunday, 12 June 2022 at 10:40:02 UTC, Max Samukha wrote:

>

I'm yet to meet a D user that wouldn't be surprised 'private' is module-level.

Hi. My name's Mike. Nice to meet you.