5 ms·
I guess I would politely argue that creating new functions would make reading code harder in basic example such are this. You'll be jumping all round or possib
by randomerr 9y ago
I guess I would politely argue that creating new functions would make reading code harder in basic example such are this. You'll be jumping all round or possibly separate files. Obviously larger logic tress should be pruned. Side note: a lambda function may get around this specific instance.
- Sean1708 9y agoThe simple cases do come up though. I've written plenty of functions which amount to little more than a single if-statement and I have had people ask me to make changes like foo(things) { stuff = do_work(things); if (stuff) { return a; } else { return b; } } into foo(things) { stuff = do_work(things); if (stuff) { return a; } return b; } in code reviews.