|
|
|
|
|
by Kamq
1147 days ago
|
|
That's fair if you only have 100 lines of code, but I don't think it automatically follows that the best solution for 10,000 lines of code is 1,000 ten line functions. There's a tradeoff between understanding the function itself and understanding how/where the function is used (and therefore understanding what will break when that function is changed). The best heuristic I've got at the moment is roughly the square root of the size of the module. So, for the 10,000 line module, my vague instinct is that I'll have one hundred functions approximately one hundred lines each. That's not a hard and fast rule, just an observation about tradeoffs and I would definitely expect (quite possibly even most) functions to differ significantly without losing sleep over it. |
|