Preparing for the New DIP Process

Jordan Wilson wilsonjord at gmail.com
Sat Jan 27 07:38:56 UTC 2024


On Saturday, 27 January 2024 at 05:14:18 UTC, FairEnough wrote:
> 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.

I understood zjh's statement to be about `serious languages`, so 
it's fair to include Go.

> 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 fact that python doesn't _enforce_ this demonstrates there 
are languages which have accepted a weakening of the concept of 
pure OOP object encapsulation, in return for something else 
beneficial to the language (I assume).

> 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?

(Q1) Are there any circumstances where a programmer might need 
the guarantees of a safe language?

(Q2) What problems could potentially occur when an unsafe 
language is used?

(Q3) Are C/C++ serious languages?



More information about the Digitalmars-d-announce mailing list