Extending D's support for object-oriented design with private(this)

Basile B. b2.temp at gmx.com
Mon Apr 29 13:39:17 UTC 2024


On Thursday, 25 April 2024 at 05:37:24 UTC, NotYouAgain wrote:
> TITLE: Extending D's support for object-oriented design with 
> private(this)
>
> NOTE: Only civil and well-informed discourse on this idea is 
> welcome.
>
> [...]

The D solution is to encourage splitting modules. However this 
has for side effect more syscalls (to load the files) and more 
parsers instances. Maybe this aspect could be studied in order to 
propose arguments. Also splitting may encourage to create several 
modules that finally can only work together (i.e that makes sense 
to put everything together so the split can be seen as "absurd").

So far the discussion is getting less and less serious and 
ressembles to what we've already seen in the past, in the 
"general" NG.

Personally I casually use FPC, which has `strict private` (i.e 
`private(this)`) and `strict protected` (i.e `protected(this)`. I 
dont find them essential but as a matter of discpline I have used 
them a couple of time and found them to be useful, in certain 
cases. For example presentation and logic implemented in the same 
module, but be sure that the presentation will only use the 
getters/setters of the logic and not the fields.


More information about the dip.ideas mailing list