News for hackers. Stuff that matters.
Re:Function Length by mishkovski on Friday December 02, 2016 @08:42AM (#13088436)
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.

Re:Function Length by AnimalMuppet on Friday December 02, 2016 @12:11PM (#13090346)
> There is a less chance to have a bug in a very small function than moderately sized, but "clean" function.

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.

Re:Function Length by spronkey on Sunday December 04, 2016 @12:16AM (#13098887)
I think realistically in many cases the buggedness will still favour many smaller functions - if for no other reason than they must all be named.

The higher level function is then easy to read. The lower level functions get a name that can be checked more easily against an implementation if needed.