2 ms·
> in most cases a sufficiently long function will have opportunities for pulling out functions with sensible signatures that make sense outside that context. A
by bsder 2y ago
> in most cases a sufficiently long function will have opportunities for pulling out functions with sensible signatures that make sense outside that context.
And will make understanding the function a lot more difficult.
If you want an example of this, look at any C++ code that uses DX12 or Vulkan. It will be atomized sufficiently that you'll have to hunt through dozens of files to figure out which constructor/destructor where something fired. Part of the problem is that C++ discourages naked functions operating on structs rather than member functions on classes.
Whereas, if those functions were still all linear in a single function, you'd find what you were looking for in the same file you were already in.
That having been said, I'll probably organize that big function as though it were separate functions. But, then, I'm not allergic to adding an extra block level here or there which GASP might exceed 80 columns.