2 ms·
People split classes for visual reasons? That sounds unwise. I only ever split because the class is getting too large, or because some functionality is better
by selfhoster11 5y ago
People split classes for visual reasons?
That sounds unwise. I only ever split because the class is getting too large, or because some functionality is better off being moved to its own class. And those other classes also should preferably only have one or two methods exposed to the outside, there's nothing worse than a large surface area unless it's a library class.
- ratww 5y agoYep, you are completely right, this is extremely unwise. Problem is, a lot of material aimed at beginner developers basically instructs that. Also a lot of linter documentation shepherds users into doing it (I'm thiking of some Ruby linters here). > there's nothing worse than a large surface area unless it's a library class Yep, exactly. Even big classes are better than tightly-coupled classes with large surface area.