Skip to main content
changed answer slightly to be a bit more formal. Fixed some spelling issues
Source Link

Simply put yes, its not good form to do this and I'll tell you why, a. A bit later when your solution becomes big you will forget where the classes are as the file name will no longer represent what the contents are, whats theWhat's your filename? Is it AnimalPersonObject.cs thats just, that's not feasible.clear its multiple classes rather a single class called AnimalPersonObject

Sure you can get around this by using features in tools like resharperResharper to jump to types, but 1 class per file (including interfaces) is really the backbone of any code standard I've ever seen, not just in .netNet but in javaJava and c++C++ and lots of other languages, those that don't often have maintainancemaintenance issues and. As currently written you will find junior devsdevelopers finding it hard to grasp the code.

Almost all code optimisation tools will tell you to move the classes into a seperateseparate file, so for me yes this is a code smell and needs some oustsomething to neutralise it :)

Simply put yes, its not good form to do this and I'll tell you why, a bit later when your solution becomes big you will forget where the classes are as the file name will no longer represent what the contents are, whats the filename AnimalPersonObject.cs thats just not feasible.

Sure you can get around this by using features in tools like resharper to jump to types, but 1 class per file (including interfaces) is really the backbone of any code standard I've ever seen, not just in .net but in java and c++ and lots of other languages, those that don't often have maintainance issues and you will find junior devs finding it hard to grasp the code.

Almost all code optimisation tools will tell you to move the classes into a seperate file, so for me yes this is a code smell and needs some oust to neutralise it :)

Simply put yes, its not good form to do this and I'll tell you why. A bit later when your solution becomes big you will forget where the classes are as the file name will no longer represent what the contents are, What's your filename? Is it AnimalPersonObject.cs, that's not clear its multiple classes rather a single class called AnimalPersonObject

Sure you can get around this by using features in tools like Resharper to jump to types, but 1 class per file (including interfaces) is really the backbone of any code standard I've ever seen, not just in .Net but in Java and C++ and lots of other languages, those that don't often have maintenance issues. As currently written you will find junior developers finding it hard to grasp the code.

Almost all code optimisation tools will tell you to move the classes into a separate file, so for me yes this is a code smell and needs something to neutralise it :)

corrected language as c is not object orientated and knows nothing of classes
Source Link

Simply put yes, its not good form to do this and I'll tell you why, a bit later when your solution becomes big you will forget where the classes are as the file name will no longer represent what the contents are, whats the filename AnimalPersonObject.cs thats just not feasible.

Sure you can get around this by using features in tools like resharper to jump to types, but 1 class per file (including interfaces) is really the backbone of any code standard I've ever seen, not just in .net but in java and cc++ and lots of other languages, those that don't often have maintainance issues and you will find junior devs finding it hard to grasp the code.

Almost all code optimisation tools will tell you to move the classes into a seperate file, so for me yes this is a code smell and needs some oust to neutralise it :)

Simply put yes, its not good form to do this and I'll tell you why, a bit later when your solution becomes big you will forget where the classes are as the file name will no longer represent what the contents are, whats the filename AnimalPersonObject.cs thats just not feasible.

Sure you can get around this by using features in tools like resharper to jump to types, but 1 class per file (including interfaces) is really the backbone of any code standard I've ever seen, not just in .net but in java and c and lots of other languages, those that don't often have maintainance issues and you will find junior devs finding it hard to grasp the code.

Almost all code optimisation tools will tell you to move the classes into a seperate file, so for me yes this is a code smell and needs some oust to neutralise it :)

Simply put yes, its not good form to do this and I'll tell you why, a bit later when your solution becomes big you will forget where the classes are as the file name will no longer represent what the contents are, whats the filename AnimalPersonObject.cs thats just not feasible.

Sure you can get around this by using features in tools like resharper to jump to types, but 1 class per file (including interfaces) is really the backbone of any code standard I've ever seen, not just in .net but in java and c++ and lots of other languages, those that don't often have maintainance issues and you will find junior devs finding it hard to grasp the code.

Almost all code optimisation tools will tell you to move the classes into a seperate file, so for me yes this is a code smell and needs some oust to neutralise it :)

Source Link

Simply put yes, its not good form to do this and I'll tell you why, a bit later when your solution becomes big you will forget where the classes are as the file name will no longer represent what the contents are, whats the filename AnimalPersonObject.cs thats just not feasible.

Sure you can get around this by using features in tools like resharper to jump to types, but 1 class per file (including interfaces) is really the backbone of any code standard I've ever seen, not just in .net but in java and c and lots of other languages, those that don't often have maintainance issues and you will find junior devs finding it hard to grasp the code.

Almost all code optimisation tools will tell you to move the classes into a seperate file, so for me yes this is a code smell and needs some oust to neutralise it :)