Why is D unpopular
Fry
fry131313 at gmail.com
Mon Jun 13 11:27:27 UTC 2022
On Monday, 13 June 2022 at 10:51:10 UTC, Mike Parker wrote:
> On Monday, 13 June 2022 at 10:44:43 UTC, bauss wrote:
>> On Monday, 13 June 2022 at 10:43:09 UTC, bauss wrote:
>>> On Monday, 13 June 2022 at 10:13:30 UTC, Mike Parker wrote:
>>>>
>>>
>>> Look, I'm not against the logic, I completely understand it
>>> from the perspective of that a subclass shouldn't have access
>>> to private members of the class it inherits from, BUT
>>> remember in D private doesn't mean private to the class, so
>>> the symbol should only be private when accessed from anywhere
>>> but the module.
>>
>> To add on to this; it's not a matter of what's more logical,
>> but simply that D is contradicting itself, so either D stops
>> being referred to as "module private" or this will be deemed
>> an unfinished feature/bug.
>
> And I'm arguing that this is exactly what we should expect from
> private-to-the-module, since B is not declared in the same
> module as the superclass, so it's neither unfinished nor a bug.
Now THIS is why D is unpopular. It is a unfinished or a bug,
while the people maintaining it say it isn't.
Take the source code from the original post:
https://forum.dlang.org/post/yyurtzlglypsvgizxodg@forum.dlang.org
```
import b;
void handle(Bar child)
{
child.Foo._c += child.c; // works
child._c += child.c; // error no property _c
}
```
Both work, you can access `_c` through child and it is a also
private and can't be accessed through child. So which is it? Is
this what you define as "working" as intended?
More information about the Digitalmars-d
mailing list