3 ms·
> And there's no arbitrary limitation on your code such that a class can only have 10 methods in it, or 100 lines, or some other silly thing that forces you in
by feoren 5y ago
> And there's no arbitrary limitation on your code such that a class can only have 10 methods in it, or 100 lines, or some other silly thing that forces you into creating a more convoluted architecture with more indirection.
I've never heard of such a restriction, even in very early programming languages. What language are you thinking of where you're limited to a specific number of methods or lines per class?
- Jtsummers 5y agoThey're making a hyperbolic allusion to texts like Clean Code which promote short methods and relatively small source files (recommendations usually in the low 100s of SLOC). Not to actual language restrictions.
- ljm 5y agoIt's not particularly hyperbolic when using, say, Rubocop for Ruby. Those are pretty much the default settings (methods no longer than 5 or 10 lines, classes no longer than 100, etc.). You can change the defaults of course but there is one class of software engineer which will treat those as gospel.