   C# and 'static'
  I'm a total C# noob and I've been learning about static classes, methods and constructors. After reading, I understand the difference between static and non-static classes, but none of the books I've read tell me when they're useful.When is a class (or method or constructor) a candidate for being static?Are there any negative issues when using static objhects or methods?Thanks.   
  Static methods on a class tend to be helper methods that are associated with the class, but don't need a class instance to do their work. For example, there's int.Parse(string). Turning a string into an int doesn't need a int instance to work, but is associated with it.As for negative issues, there are a few. The primary issue is that static members tend to be restrictive design-wise. It's not uncommon for a design to shift subtly where you now could use more than one instance, but since it's static, there's only one. The other problem is that static fields tend to be problematic when doing multi-threading since they are (usually) difficult to compartmentalize.Take a look through the standard library. See where statics are used. That will give you a better feel for them.   ;  I'd like to point out another usefulness of static members that I've found: constants.  Constants (declared with const keyword) are certainly useful, but seem to have their limitations.  Notably, they can only be primitive types (int or string, for example).  Also, as far as I can tell, they are resolved at compile-time.  While probably not worth worrying about now, compile-time constants may impact reusability later on, when combining different assemblies.When I want a constant that is not a primitive type, I've been using static data members (or better yet, readonly static).  Then, in a static constructor, I can initialize my static data.  For example,class ClassWithConstants{   // const someOtherClass <-- Error, const must be a primitive type   static readonly SomeOtherClass someOtherClass;   // static constructor gets called before any instance constructors   static ClassWithConstants()   { // initialize static data someOtherClass = new SomeOtherClass(...); // put initialization code here...   }...}Also, coming from C++, I find it useful to sometimes group related functions together.  These functions do not necessarily 'belong' to any one class.  In C#, using a static class accomplishes this.Of course, as I am new to C# myself, please feel free to correct me if I am wrong about any of this;  As a general rule, static is for when something belongs to the class as a whole not an instance.One that recently came up was unique ID for instances.  A static ID and static method was a good was to give out unique IDs.theTroll   