Code That Says Exactly What It Means
Peter C
peterc at gmail.com
Tue Oct 28 23:15:36 UTC 2025
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 ;-)
More information about the Digitalmars-d
mailing list