|
|
|
|
|
by jcelerier
2322 days ago
|
|
> but divide-and-conquer is a pretty time-honored approach to effective problem solving. only if you can also divide and conquer the amount of persons that will dev, because now when there was one name to learn and assign meaning to, there are ten different names. I am speaking as someone who used to have a hard limit on function length (20 lines, in Allman style :-) ) - this ended up being really harmful and creating way too complex code sometimes. |
|
To give you an example, when using Java's stream functionality, I tend to insert every method call in the chain after stream() in a new line, for readability:
When I scan the method to see if it should be broken down, the fact that this code occupies 4 lines doesn't really contribute much to my decision to refactor the method into several methods, because those 4 lines are accomplishing one thing.