private(this) vs LINT

forkit forkit at gmail.com
Tue Jun 28 22:03:54 UTC 2022


On Tuesday, 28 June 2022 at 20:58:56 UTC, Daniel N wrote:
>

I'm reading a thesis at the moment, and I was just struck by this 
statement:

"the price of enabling cooperative interaction is that 
destructive interference is enabled as well."

Without something like private(this), hazardous interactions are 
inevitable, and will increase with scale (e.g. having 20+ friend 
functions in your class ;-)

Of course useless isolation is not ideal either.

Another quote from the thesis:

"As language and system designers, our goal is to help 
programmers move into the upper right corner, where the 
interactions needed for cooperation are enabled while minimizing 
the extent to which problematic interactions are thereby also 
enabled."

That is precisely what private(this) could help facilitate.



More information about the Digitalmars-d mailing list