4 ms·
One thing I like which nobody ever seems to mention, is that when you divide your code into smaller functions it helps to have your functions actually take inpu
by jernfrost 11y ago
One thing I like which nobody ever seems to mention, is that when you divide your code into smaller functions it helps to have your functions actually take inputs and give outputs. It is very hard to read code which is just line after line of functions taking no arguments and returning nothing. No matter how descriptive your method names are, it will just end up being more confusing than if you simply wrote out all the code contained in those functions instead.
People need to see how the code flows and how things are logically connected. That is impossible to do with reams of methods operating exclusively on member variables.
I guess this is just another way of stating the benefits of functional programming. People do modularization at the function/method level so badly so often that I often think talking about modularization at class level, is beginning at the wrong end.
So many struggle with modularization at small scale.