Re:Facts every web dev should know before they burn out and ...
by ratww on Thursday October 21, 2021 @08:00AM
(#28943167)
Yep, 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.
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.