Apr-01-2019, 09:56 PM
Quote:A book I recently read (Clean Code by Robert C. Martin) said classes should be kept small, and that if a class is large then it should be divided into smaller classes
This all depends. I would say instead that a class should pertain to one process. There may be many parts to the process, and all of the pieces should be kept together. Separating a class just because it's getting too large, is not (in my opinion) a good reason to split it into multiple classes.
Methods, on the other-hand should try to solve one problem, and if that problem contains other parts, those parts should be separated into separate methods (unless simple).