3 ms·
>A function that does one thing and one thing only is: >- generally short >- testable > ... This is true only if the function decomposition is intelligently do
by tytso 13y ago
>A function that does one thing and one thing only is:
>- generally short
>- testable
> ...
This is true only if the function decomposition is intelligently done. The problem is that with callbacks, the function decomposition is forced on you based on what needs to be done asynchronously (i.e., mostly I/O). As a result, it breaks apart the flow of control into little tiny pieces that may be only loosely coupled with the most logical way to decompose functionality.
So your statement may be true in general, but it may not be applicable when it comes to how to best handle callback functions.