Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 976689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:47:15+00:00 2026-05-16T03:47:15+00:00

Is there a general practice when it comes to how to organize your classes

  • 0

Is there a general practice when it comes to how to organize your classes in C#? Should there only be one generic class per .cs file? I see that I have Form1.cs which includes all of the classes relevant to “Form1”. However I could create a file named Misc.cs which includes all misc classes. Not sure which way to go so everything stays organized.

Or should I organize them a specific way? For example, I am accessing a MySQL database, so i’m creating a MySQL wrapper which I will store in MysqlWrapper.cs and name the class to match it. Should I create a new .cs for each class I create?

Or should I combine only the ones that use similar “using” namespaces such as System.Text;
using System.Windows.Forms; etc?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T03:47:15+00:00Added an answer on May 16, 2026 at 3:47 am

    Edit – this answer is meant to supplement the good answers that others have already posted.

    Everyone else seems to be answering specifics. I’m thinking you’re going to have more “best practices” design questions.

    The official guidelines can be found here: http://msdn.microsoft.com/en-us/library/czefa0ke(VS.71).aspx

    In particular, dig into the Naming guidelines, and then into the Namespace Naming guidelines and Class Naming guidelines.

    And, as others have mentioned, please, one class per file. It makes things easier on the poor maintenance developer who will follow you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Are there any handy general items you put in your .procmailrc file?
Is there a general procedure for programming extensibility capability into your code? I am
Is there a general rule of thumb as to how many classes, interfaces etc
In Java (And in general) is there a way to make a class so
Is there a general rule of thumb to follow when storing web application data
Is there a general way to implement part of an application with JavaScript and
I would like to know if there are general rules for creating an index
In designing any desktop applications, are there any general rules on how much memory
Is there any easy/general way to clean an XML based data source prior to
Certainly there's the difference in general syntax, but what other critical distinctions exist? There

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.