Why is D unpopular?

forkit forkit at gmail.com
Sat Jun 11 02:01:19 UTC 2022


On Saturday, 11 June 2022 at 01:00:44 UTC, H. S. Teoh wrote:
>
> .. As I said, opinions differ on this.
> You say the class ought to be unit of encapsulation,
> Walter says it should be the module.

No. This is not my argument. It never has been.

To use yet another analogy (but not taken to it's extreme though):

Think of the module as a house.

Now think of it as a house *without* doors inside it - no 
barriers - anyone can go anywhere.

Now consider what happens as you increase the number of people 
living in it, beyond one.

Very quickly, even at a small number, you start to realise that 
hey, maybe we need a door here, or over there.

But tough luck. Cause this house does not accomodate doors.

If you want even the most modest level of privacy, you need to go 
build your own house.

What I like to do, is put rooms in my house. Cause we're a 
family, and we like living together - but some of us really do 
want a reasonable, modest level of privacy - without having to go 
build our own house.

Consider the class, as being the door that provides that.


More information about the Digitalmars-d mailing list