Comment by zahlman

4 hours ago

> Split them up into multiple functions and there is more scrolling, and now also jumping around because the functions could be anywhere.

No, this is the fundamental misconception used in defense of longer functions.

With a long function, you must scroll no matter what. If you're interested in every detail, you scroll. If you want to figure out the logical steps involved, you scroll (and likely have to take notes as you go). If you want to ignore a step for now, you scroll over it.

With properly factored code, you only jump away when you need to. If you want to figure out the logical steps involved, you just read them off. If you want to ignore a step for now, you just ignore it. If you're interested in every detail, you get to start with an overview, and then you jump around. But caring about details is the exceptional case. Most of the code works most of the time in any sane development practice; when the current code works, the details don't help with understanding the current function.

Jumping around is also not more difficult than scrolling, with a proper editor.