Eric describes a new Whidbey feature focused on creating those ‘utility’ classes in the style of System.Math or System.Environment:
_C# Whidbey Featurette #3: Static classes Because all functions in C# must live inside of a class, there are some clases – System.Math is a canonical example – that are merely collections of static methods. Since it's useless to create an instance of such a class, in current versions of C#, you can protect against this by creating a private constructor. The constructor can never be called, and therefore no instance can be created._ _There are three issues with this approach:_
Of course, you'll have to click on the title of his post to read more 🙂 <div class="media"> [Listening to: Do This Anymore – [Nickelback](http://www.windowsmedia.com/mg/search.asp?srch=Nickelback==) – The Long Road (04:04)] </div>
Thoughts on this post? Feel free to reach out on Twitter!
2004-04-14 22:05 +0000
e06898f @ 2019-03-31