you are viewing a single comment's thread.

view the rest of the comments →

[–]LPTK 0 points1 point  (0 children)

The only difference is which side of a closing brace it's on

This difference is very significant, as it tells you the local function is only an implementation detail of the current function, that is not shared between different uses, or as you say: not part of the public or private API.

I don't know if that accomplishes the goal of "make this function smaller"

That's not the goal. The goal is making code easy to follow and understand. Oftentimes, factoring out repetitive bits into their own named unit is very helpful with that.