|
|
|
|
|
by eterm
163 days ago
|
|
This is from page 37 of Clean Code: > Even a switch statement with only two cases is larger than I'd like a single block or function to be.
His advice that follows, to leverage polymorphism to avoid switch statements isn't bad per-se, but his reasoning, that 6 lines is too long, was a reflection of his desire to get every function as short as possible.In his own words, ( page 34 ): > [functions] should be small. They should be smaller than that. That is not an assertion I can justify. He then advocates for functions to be 2-3 lines each. |
|
That's both true, but long way away from "every line should have it's own method", but I guess parent exaggerated for effect and I misunderstood them, I took it literally when I shouldn't.