`restricted` member variables

claptrap clap at trap.com
Wed Jun 22 23:06:48 UTC 2022


On Wednesday, 22 June 2022 at 13:14:21 UTC, Ola Fosheim Grøstad 
wrote:
> On Wednesday, 22 June 2022 at 13:08:44 UTC, claptrap wrote:
>> On Wednesday, 22 June 2022 at 11:23:47 UTC, Ola Fosheim 
>> Grøstad wrote:
>>> On Wednesday, 22 June 2022 at 11:01:27 UTC, claptrap wrote:
>>>> On Wednesday, 22 June 2022 at 08:16:26 UTC, Ola Fosheim 
>>>> Grøstad wrote:
>>>>>
>>>>> It is useful when building your model. That is too obvious 
>>>>> a point to argue: Start out by making everything maximally 
>>>>> constrained, then loosen up (reluctantly) when you have no 
>>>>> other option.
>>>>
>>>> 1. Nobody does that.
>>>
>>> Wrong.
>>
>> What do you mean by "maximally constrained"?
>
> It means that you make everything hidden outside the scope, it 
> also means using const, don't apply shared etc etc.
>
> Basically, it means you start out providing minimal access both 
> within the module and externally.

That's a contradiction, you cant be "make everything hidden 
outside the scope" and "start with minimal access externally" at 
the same time.

If you mean you start by hiding things unless you are absolutely 
sure it needs to be in the public API, that makes sense.

But if your writing say a file class, you wouldn't start with 
Open and Close private, that'd just be retarded.


More information about the Digitalmars-d mailing list