has anyone got any actual examples where large functions made sense because i’ve yet to see one unless it’s composing other functions.
Reposted from
vijay
hot take: big functions are not inherently bad.
sometimes shit is just complex, and breaking it up just causes unnecessary cognitive overhead
sometimes shit is just complex, and breaking it up just causes unnecessary cognitive overhead
Comments
Even embedded platforms make my code sinful with their bootloader stuff
no actual logic is happening in the big one so it’s easy to fit it all in your working memory.
and even then it could probably be reduced.
You just end up with a god function. That becomes brittle to change as it as so much business logic crammed into it. Over time its purpose gets lost.
i just go based on vibes, if the things in a function feel like one conceptual thing I keep them together 🤷♂️ but usually most functions i write are less than 200 lines (not a hard rule tho)
1/2
2/2
i consider them to be orchestration less than functions.
but most examples of long functions i have seen are not an example of this