Code That Says Exactly What It Means
Peter C
peterc at gmail.com
Wed Oct 29 01:32:38 UTC 2025
On Wednesday, 29 October 2025 at 01:18:42 UTC, Lance Bachmeier
wrote:
> On Tuesday, 28 October 2025 at 23:15:36 UTC, Peter C wrote:
>> On Tuesday, 28 October 2025 at 22:36:58 UTC, Lance Bachmeier
>> wrote:
>>>
>>> ..
>>> Over the years this has come up many times. Can you provide
>>> an example showing the value of doing that? I understand that
>>> maybe that's your preference for whatever valid reason, but
>>> I've never seen anyone give an example where it's actually a
>>> constraint.
>>>
>>> If you want to push on this, that's where you should start.
>>> Because every previous such proposal I've seen has died, as
>>> the people requesting it keep arguing from authority that
>>> it's the correct way to do things, rather than demonstrating
>>> the benefit of a major change to the language.
>>
>> Example after example will get nowhere, fast.
>>
>> It's a matter or principle, not examples.
>>
>> The principal behind one perspective is: Modules are
>> collaboration units, types are sovereign owners.
>>
>> The principle behind the other perspective says: Modules
>> disolve ownership, and they are all or nothing.
>>
>> I am a firm believer, that each type should be able to guard
>> its invariants, even in a collaborative module.
>>
>> It just so happens that I primarily use class types, so the
>> principle itself often gets overlooked in the discussion, and
>> (some) people focus their attention on their dislike of OOP
>> instead ;-)
>>
>> I firmly believe that types should retain their sovereignty,
>> even in within a module, and scopeprivate would accomplish
>> this.
>>
>> Collaboration, should not erase ownership.
>>
>> Can you give me an example where it should ;-)
>
> The problem with your approach is that you're proposing a major
> change to the language. You need to demonstrate the benefit.
> I'm not proposing anything, just telling you that if you don't
> want to dump your time in a hole, you're going to need to
> provide a more compelling argument to the powers in charge
> (which does not include me). I don't recall anyone ever arguing
> for this feature and making a real attempt to justify it as a
> language change.
Honestly, I couldn't care less about D so much as the principle
that "Collaboration, should not erase ownership".
Nobody has ever demonstrated why it should - most likely, because
it's not a valid principle.
It's sad that a discussion on this principle has to always get
derailed. A few are already trying hard to do that.
I guess this is a discussion for a more professionaly minded
audience - so I'll leave it for now.
btw. If I had been involved when someone suggested friends in
C++, I would have actively argued the same principle. So it's now
about D per se. Actually, I would have argued in C++, for
friendprivate ;-)
More information about the Digitalmars-d
mailing list