| ▲ | CraigJPerry 2 hours ago | |
What would be a good example of the kinds of things a 100 line function would be doing? I don't see that in my world so i'm naively trying to inline functions in codebases i'm familiar with and not really valuing the result i can dream up. For one, my tests would be quite annoying, large and with too much setup for my taste. But i don't think i'd like to have to scroll a function, especially if i had to make changes to the start and end of the function in one commit. I'm curious of the kinds of "long script" flavoured procedures, what are they doing typically? I ask because some of the other stuff you mentioned i really strongly agree with like "Focus on separating pure code from stateful code" - this is such an under valued concept, and it's an absolute game changer for building robust software. Can i extract a pure function for this and separately have function to coordinate side effects - but that's incompatible with too long functions, those side effectfull functions would be so hard to test. | ||
| ▲ | brodo 2 hours ago | parent [-] | |
Containing the giant switch statement in a byte code interpreter or a tokeniser. | ||