|
|
|
|
|
by mishkovski
3492 days ago
|
|
There is a less chance to have a bug in a very small function than moderately sized, but "clean" function. It is also easier to write a test for a smaller function. Having the implementation in many smaller functions also makes the code more readable if their naming is good. |
|
Maybe so. But you need several of the very small functions to do the same work as the moderately sized function, and those several very small functions have to interact with each other. So did the total chance of a bug go up or down? It's not clear, but I lean toward the one moderately-sized function being more likely to be bug-free.