Adding a new design constraint to D

Paul Backus snarwin at gmail.com
Tue Jun 14 10:26:09 UTC 2022


On Tuesday, 14 June 2022 at 05:43:49 UTC, forkit wrote:
> Is the cost, the unjustified cognitive burden of having both 
> 'private' and 'private(scope)', instead of just 'private'?
>
> Is the cost - it's just too complicated to change the compiler 
> source to accomodate this option?
>
> What do you think the cost of adding such a feature is?

The main cost is the opportunity cost [1]. Any effort we spend 
implementing, documenting, debugging, and teaching 
'private(scope)' reduces the amount of effort we can spend on 
other things. Likewise, any effort new users learning D have to 
spend on learning 'private(scope)' reduces the amount of effort 
they can spend learning other parts of the language (or, for that 
matter, using D to solve their problems).

So the relevant questions here are:

1. Among all of the possible improvements we could make to D, is 
this particular one the *best* use of our limited resources, as a 
community?

2. Among all of the additional language features we could ask new 
users of D to learn, will this particular one give them the 
*most* benefit for their effort?

[1] https://en.wikipedia.org/wiki/Opportunity_cost


More information about the Digitalmars-d mailing list