3 ms·
Well, this is leading a bit astray. In principle I agree with you, but in general procedural constructs are not harmful and should be used where appropriate.
by moe 14y ago
Well, this is leading a bit astray.
In principle I agree with you, but in general procedural constructs are not harmful and should be used where appropriate.
500 lines is indeed a bit much, but I've seen through 100 line methods without an urge to refactor.
The best programs are those that have both; good use of patterns and the odd suspiciously long method if appropriate.
The worst programs are not only the classic spaghettis but also those that dogmatically stick to a pattern even where it makes no sense. Java is notorious for the latter, but I also often see ruby programs where the author religiously clinges to the belief that no method can be allowed to exceed 5 lines of code. That, in combination with misunderstood unit-testing (foo.MUST_RECEIVE :bar), often leads to ridiculously tight coupling and effectively a monolithic brick that is resilient to change.
I call these programs Gnocchi-code. A close relative of spaghetti, just higher density...
- gnaritas 14y agoOf course, that's where taste comes in. And I did say "as an exercise", I wasn't suggesting not using them ever, but as a kata to see how much you can do with only objects.