Q&A

Q1:Should I always try to place code into instance classes rather than static classes?
A1: Not necessarily. As with most things, there are no hard and fast rules. Correctly programming instance classes takes some skill and experience, and programming static is easier for the beginner. If you want to experiment with instance classes, I encourage you to do so. However, don't feel as though you have to place everything into instantiated classes.
Q2:I want to create a general class with a lot of miscellaneous methods—sort of a “catchall” class. What is the best way to do this?
A2: If you want to create some sort of utility class, I recommend calling the class something like clsUtility. Then you can use this class throughout your application to ...

Get Sams Teach Yourself C#™ in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.