Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple classes in a single .cs file - good or bad? [duplicate]

Tags:

c#

c#-4.0

Possible Duplicate:
Is it a bad practice to have multiple classes in the same file?

Is it advisable to create multiple classes within a .cs file or should each .cs file have an individual class?(Class file name also Animal.cs)

public class Animal { }  public class Person { }  public class Utility { } 
like image 307
Learner Avatar asked Aug 02 '12 04:08

Learner


1 Answers

Simply say good practice is one class from one file. BUT if your application is quite small you can use several classes in one file.

like image 146
TechGuy Avatar answered Sep 23 '22 08:09

TechGuy