This is not really about subroutines, it's about abstractions. Good abstractions decrease cognitive load, bad ones increase it. The one true answer is to aim for good abstractions, and not factor code into subroutines at arbitrary boundaries.
For example, adding two n-length vectors is a good abstraction ("vector_add"). Adding two n-length vectors then multiplying the magnitude of the result by 3 is a bad abstraction.
> I am beginning to reject that there is a "one true answer."
There are basically no guidelines that always apply. Novices should stick to them, and people with more experience can recognize when they don't apply.
It's usually very safe and convenient to not inline pure functions. At least while debugging.
Re:John Carmack on Inlined Code (2014)
by jschwartzi on Tuesday July 19, 2016 @08:59PM
(#12126143)
The sooner you learn that there are no hard and fast rules, the easier life will be for your teammates and for anyone you try to lead. Most of the conflicts I have with my lead boil down to him wanting to resolve a decision using a hard always/never dichotomy, and me wanting to use my best judgement.
My gripe is when we argue against having the full solution in your mind as you work the pieces. Logically, it makes sense to reduce everything down to named things. Cognitively, that is expensive.
And yes, I'm responding with an equally opposing strawman. I am beginning to reject that there is a "one true answer."