3 ms·
IMO the advantage of small functions is that they act as a form of documentation. In the given example (short main) I can see that it loads some configuration w
by mvaliente2001 9y ago
IMO the advantage of small functions is that they act as a form of documentation. In the given example (short main) I can see that it loads some configuration without having to worry about how it does it. With the long main, I'm forced to see the details.
Also, if we're talking about OOP, small methods are better. With small methods it's easier to change behavior by subclassing. In several occasions, I've been forced to make a subclass with a copy of a big method with only one line changed.