Non-ugly ways to implement a 'static' class or namespace?

ProtectAndHide ProtectAndHide at gmail.com
Thu Feb 16 21:23:53 UTC 2023


On Thursday, 16 February 2023 at 20:56:00 UTC, ProtectAndHide 
wrote:
>

My agrument is this:

Objects are data abstractions with an interface of named 
operations and a hidden local state. Does anyone disagree with 
this?

D does not have a language mechanism, but rather a design 
mechanism that supports the above.
By that I mean, you cannot use a language 'declaration' mechanism 
to enforce the above, but rather have to revert to a design 
mechanism - putting the class that represents that object into a 
module by itself. Does anyone disagrre with this?

Forcing programmers to use a design mechanism rather than a 
language mechanism to achieve the above abstraction is wrong. 
This seems to be the source of the disagreement, correct?

So some think its fine to force this onto programmers? That is 
essentially your argument... right?


More information about the Digitalmars-d-learn mailing list