Coffeehouse Thread

3 posts

Eric Gunnerson - C# Static Classes in Whidbey

Back to Forum: Coffeehouse
  • User profile image

    Eric Gunnerson, Visual C# Program Manager at Microsoft blogs about new features in C# for VS.NET 2005 including this post on static classes.

  • User profile image

    If you have a static class full of static methods aren't you really just defining macros (without all of the problems that go along with macros)?

  • User profile image

    You know, I agree with you… Static classes can *certainly* be abused.  Static classes are not a very “OO” friendly concept.  That said, good API design is a compromise between pure OO design and usability.  There are just some cases where the problem space doesn’t warrant full OO mapping…  Check out System.IO.Path as an example.  

    We have used static classes a judiciously in the framework and it is good to see that pattern being enforced in the compiler.  

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.