3 ms·
All the reasons boil down to one: human brains can not hold too much working memory.
by chj 13y ago
All the reasons boil down to one: human brains can not hold too much working memory.
- taeric 13y agoIs it a form of irony when programs wind up overwhelming this memory with too many functions? :)
- AnimalMuppet 13y agoWhere do you spend your time? I spend some of my time trying to find the right function, and that gets harder if there are more functions. But I spend more of my time trying to understand and/or modify that function, and that gets easier with smaller functions. So more, smaller functions winds up being a net win (up to some limit, of course...)
- taeric 13y agoThis 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.