Preparing for the New DIP Process

FairEnough FairEnough at gmail.com
Sat Jan 27 05:14:18 UTC 2024


On Saturday, 27 January 2024 at 04:35:11 UTC, Jordan Wilson wrote:
> On Saturday, 27 January 2024 at 02:18:29 UTC, zjh wrote:
>> On Saturday, 27 January 2024 at 02:12:25 UTC, FairEnough wrote:
>>>
>>
>>
>> `module private and no class private` goes against the 
>> `consistency, integrity, encapsulation, and redundancy` 
>> pursued by D, just to maintain the uniqueness between `D and 
>> C++`. This is very `funny` and not what `serious language` 
>> should have!
>
> Does Go and Python qualify as serious languages?
>
> Jordan

Go does not have a class type so it's of little value to compare 
Go to D in this respect.

Python does have a class type, but no explicit means to declare 
private members, other than the underscore 'convention'.

I don't use python so I don't really know whether and to what 
extent that convention is followed. But that fact that there is 
this convention would surely demonstrate some need for it??

The only questions for you to ponder are:

(Q1) Are there any circumstances where a class type might need to 
retain control over its state from other code within the same 
module (including unittest code)?

(Q2) What problems could potentially occur when a class types 
state is always leaked into the module.

If I posed these 2 questions to you during a job interview, how 
would you answer them?



More information about the Digitalmars-d-announce mailing list