Adding a new design constraint to D

forkit forkit at gmail.com
Tue Jun 14 11:27:33 UTC 2022


On Tuesday, 14 June 2022 at 11:22:58 UTC, Paul Backus wrote:
> On Tuesday, 14 June 2022 at 10:54:17 UTC, forkit wrote:
>> On Tuesday, 14 June 2022 at 10:26:09 UTC, Paul Backus wrote:
>>>
>>> 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).
>>>
>>
>> you mean, like @mustuse ;-)
>>
>> a 'new' feature that I'll likely *never* have a need to use 
>> btw.
>
> Sure, you could make an argument that the effort spent on 
> @mustuse could have been better spent elsewhere.
>
> The main difference between @mustuse and private(scope) is that 
> @mustuse was *impossible* to simulate using existing language 
> features, whereas private(scope) can be simulated by extracting 
> the relevant code into its own dedicated module. I understand 
> that you have reasons for disliking this workaround, but the 
> fact that a workaround exists is still relevant when 
> determining what ought to be prioritized.
>

yes. so I covered this in my initial post:

---
"The next response, is that if you need this feature, then you 
can 'simulate it' by putting the class that needs this feature, 
into its own module.

However, the one-class-per-module approach, imposes its own new 
design constraint, and not one the programmer necessarily makes 
of his/her own volition.

It also does not necessarily follow, that a class in its own 
module, is there for the purposes of stipulating this constraint.

There are any number of a reason, why a class might be put into 
its own module. You cannot infer anything from that. You'd have 
to speak the designer to know intent."
---

> In any case, if you want to write a DIP, please don't let me 
> stop you. The people you have to convince are Walter and Atila, 
> not me.

I'm not at that stage yet.

I more interested in knowing what the others think about it.

I already know what 'core' think about it ;-)



More information about the Digitalmars-d mailing list