| ▲ | embedding-shape 4 days ago | ||||||||||||||||||||||
> where each line is extracted into its own method Never heard of "that style of programming" before, and I certainly know that Uncle Bob never adviced people to break down their programs so each line has it's own method/function. Are you perhaps mixing this with someone else? | |||||||||||||||||||||||
| ▲ | eterm 4 days ago | parent | next [-] | ||||||||||||||||||||||
This is from page 37 of Clean Code:
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. | |||||||||||||||||||||||
| |||||||||||||||||||||||
| ▲ | troupo 4 days ago | parent | prev [-] | ||||||||||||||||||||||
> I certainly know that Uncle Bob never adviced people to break down their programs so each line has it's own method/function There's a literal link to a literal Uncle Bob post by the literal Uncle Bob from which the code has been taken verbatim. | |||||||||||||||||||||||