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

ProtectAndHide ProtectAndHide at gmail.com
Mon Feb 6 20:56:48 UTC 2023


On Monday, 6 February 2023 at 08:26:45 UTC, Ali Çehreli wrote:
>
> ....
> In contrast, D delivers some features in an unprincipled way 
> and the programmers use combinations of those features the way 
> the see fit.

I agree, that D is unprincipled in many ways, and this is perhaps 
the biggest surprise for new comers from other 'principled' 
programming languages.

But is that a design goal for D?

> I really don't care if D had 'static class' to be used only as 
> a namespace but I don't see how this issue is terrible....

If you've ever programmed in C#, you've use static classes, and 
you've used them many times, and you'll continue to use them.

If D implemented the same abstraction as easily as C#, then C# 
programmers would find it easier to migrate code to D, perhaps. 
That's not a request, just an observation. And no, I'm not going 
to 'go write a DIP'.

Of course, if I was talking about migrating C code, you'd all be 
stumbling over yourselves to make that happen - .. build it, and 
they still won't come ;-)



More information about the Digitalmars-d-learn mailing list