11 March, 2018

... thinking in circles

programrun as it flows through the data executing commands based on
decisionpoints mandated in its execution logic. many loops are terminated
based on a length and they pick through data until some known point, maybe the
length of the data.

in the begininning of my programming days, i was only able to envision fixed
ends. loop `for` and only `for` this long, but that could be inefficient as there
may be a reson to terminate before the end, so `breaks` were used but the syntax
was ugly because the intent of the `for` appears as if it is to run all the way
through. yet, `while` hidden in its logic is a `break` whose condition needs a code
__comment__.

all the `while` a cleaner loop existed with its intent clearly
expressed and the code became more readable with less reliance on
soon-to-be-stale comments. constructs such as `each` took the `for`'s place,
spelling that actions were to happen all along the length of this line of
data.

the loops were all spelled out.

then, came the method that called itself. it didn't look anything like a loop,
just passing along what's left of the data to be handled by the next time this
method was to be called, which was right now because i'm that method and i'm
calling it, which is to say me and... was it to be an endless loop that couldn't
be because of finite resources like a python swallowing its tail?

relax...

although it may not work for everything, the terse--yet powerful--form of
recursion is somewhat poetic. the sleek and postmodern feel to code in which a
method keeps calling itself until some point at which it exits, the depth to
which is not known to the developer. instead, if the data given are still
open to processing, then we let the

(originally a guest post circa 2014 on the now-dark opinionateddeveloper.com)