On Fri Apr 28 11:00:26 2023 +0000, Giovanni Mascellani wrote:
Yeah, I expressed myself terribly. The point is not really about recursion (which, as you say, is inevitable) as about the control flow structure, which I find a bit hard to scan. In general I don't really like stuff like:
int f(...) { if (condition) { lots_of_code(); return ...; } lots_of_other_code(); return ...; }
This is fine when `lots_of_code()` is actually `a_bit_of_code()`, possibly some cleanup or simple case. Then it's clear that the function has a main linear flow with little branches when needed. If instead the function has two main cases, then they should marked more clearly; even better if one of them can be sent to another helper. With the current code it's pretty clear that `prepend_input_copy_recurse()` recurses a few times and then calls `prepend_input_copy()`, and nothign fancier than that.
Ah yes, definitely agreed there.
I'm finding myself increasingly sympathetic to the assertion that no function needs to be vertically (or horizontally) larger than a screen...