3 ms·
Other languages can sport a class full of static methods and a private stub constructor, all C# offers is the means to force a class to only contain static meth
by Pxtl 13y ago
Other languages can sport a class full of static methods and a private stub constructor, all C# offers is the means to force a class to only contain static methods and block the constructor.
You can make an all-static class in any OOP language that supports class-level methods and members.
That's my point. This argument is all semantics. There's a million little ways to create something with the functional utility of a Singleton, and there's no sense in pretending that they're vastly different.
- arethuza 13y agoIt was just idle curiosity - I wasn't familiar with the term "static class", looked it up and wondered if that particular set of features (and the term) were used in any other languages.
- Guvante 13y agoNothing special about it, it was just a cheap feature to add (static was already reserved and not previously added before class) while helping to exemplify a common protocol. The one nice thing it does provide is access to defining extension methods, which aren't allowed outside static classes.
- noblethrasher 13y agoIt's just a class that is both sealed and abstract. Therefore, all of its "methods" must be static.