One of the things in the Clean Code book really helps.
Methods and functions should be around 5 lines.
Doesn’t always work but is great to aim for.
Methods and functions should be around 5 lines.
Doesn’t always work but is great to aim for.
https://dzone.com/articles/rule-30-–-when-method-class-or
Sorry, don’t have the actual book at hand now. Still a great read though.
1 - functions are(should be) well named so anyone later on will have better understanding of the intent of the writer of the code.
2 - bugs have a harder time to hide in 5 lines of code than 30 or 300 lines of function code.
If you did not read it I recommend it or the video series based on the book.
I worked on only one code base where we more or less held ourselfs to this and the class length limit (classes really should not be more than 2-300 lines long) and it turned out pretty well.