News for hackers. Stuff that matters.
Re:Functions Should Be Short And Sweet, But Why? by taeric on Wednesday January 22, 2014 @03:10PM (#7105042)
This depends on how connected they are. If every function is a "leaf" function, then yes this is straight forward. However, that isn't possible as you have to have some functions that call other functions. At this point, you then need to worry not just about the function you are touching, but all functions that touch it. It isn't unheard of to spend the time trying to find all of the subtleties of all functions that rely on the one you are looking at.

To that end, I would think the more segmented the call trees the better. But this is often hard to see when looking at a single function/data structure. This also seems to imply that having duplication of a function is not as evil as it would seem, since it can free up many of the dependency lines you have to consider.

All of this is to say that I do not disagree with the premise; though I do think it is less clear cut.

There are no comments on this comment yet.