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

Posted by Sergio on Programmers See other posts from Programmers or by Sergio
Published on 2011-02-28T22:50:20Z Indexed on 2011/02/28 23:33 UTC
Read the original article Hit count: 514

Filed under:
|
|

Is it advisable to create multiple classes within a .cs file or should each .cs file have an individual class?

For example:

public class Items
{
    public class Animal
    {
    }

    public class Person
    {
    }

    public class Object
    {
    }
}

Dodging the fact for a minute that this is a poor example of good architecture, is having more than a single class in a .cs file a code smell?

© Programmers or respective owner

Related posts about best-practices

Related posts about c#