Is it good to have multiple class definitions in a single file? or is it preferable to have one class for each file?
I prefer one class for each file. You do not have to search for the correct file name because it is always a class name.
One class for each file.
, , , class A, class B. , , , .
class A
class B
, .
resharper, .
.
, , , , . . , , Code Complete
: " . - , . , , . , ".
, , , .
- . " " . , , ( ) - .
, , . , -/ - .
2 - .
, , , . ( ), -? - ? .
( , , ).
,
, , , devexpress ( ).
, , "" . , , , .cs 10K .
, , " ", , , . . , :
MyApplication.Interfaces MyApplication.Utils MyApplication.Controllers
, - , . , , .
. . , , intellisense , .
, , - , EventArgs , . , , . , - ??
, ( , ++). , .
- , - ... , , , ...
As long as I don't break the 1000 line barrier, I will use as many related classes as possible.
Sometimes an abstraction can be only one overridden method.
Source: https://habr.com/ru/post/1720259/More articles:Compiling a Java File Set in a Directory Tree Using the JSR 199 Compiler API - javaКак получить доступ к файлу с UNC-пути из asp.net - asp.netHow to take a screenshot from a specified site? - capture.Net Powerpoint Component - c #bluetooth to iphone - iphoneКонтроль версий для служб ReportingServices - version-controlHow to use? and ?: and: in REGEX for Python? - pythonEasy way to implement a computer board in Java - javaСохранение значений любого типа как типа, первоначально поставляемого в шаблоном factory в С++? - c++Java connection pool without JNDI? - javaAll Articles