Code That Says Exactly What It Means
Lance Bachmeier
no at spam.net
Wed Oct 29 01:18:42 UTC 2025
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.
More information about the Digitalmars-d
mailing list