The maximum number of lines per file?

How many maximum lines of code should be stored in a .cs file. Are there industry standards / best practices?

+3
source share
2 answers

I do not know how many, but there is a number that is considered best practice.

It's all about maintainability, and there is much more than the number of lines in the source file. What about the number of methods in a class? Cyclomatic complexity of the method? The number of classes in the project?

It is best to run the code metrics tool in your source code to learn more, such as NDepend .

+3
source

As little as possible to complete the task, while it remains readable.

, , , , .

, 1000 , , , .

, , .

+1

Source: https://habr.com/ru/post/1742072/


All Articles