BLOG@CACM

# Experiencing Loops in Time

Posted

Elementary programming introduces the standard programming control structures as blocks—sequence, condition, and iteration. These answer the question what to do next. As presented to a class on a board, the written form seems reasonable for the first two, but iteration doesn't strike the same note, appearing somewhat odd. Sure, sequence is critical ("So critical, class, that we take it for granted!") and taking one execution path or another, dictated by a condition, makes sense. But why exactly are loops so important in programming? Those of us with experience understand. But looping does not immediately strike new programmers as a thing, to put it in modern terms; it's not an obvious part of the phenomenology of mundane tasks. Why not?

When we experience iteration, in casual data processing, it doesn't feel… well, iterative. We search for a name in a file by scanning through papers. We add up numbers by keeping a running total. We sort maps into alphabetical or geographical order. But our concern is the progressive state rather than the return to the top of the block. Just the other day I found myself sorting decades of past issues of the Communications of the ACM into chronological order—not making this up, contrived as it sounds! I made some rough stacks according to years, then arranged some of those stacks in relative order while checking some issues in my hand for correct placement in sequence, and stopped when I was tired of the whole thing, to be continued later. A dogmatic observer might extrapolate a repeated block of discrete operations, but that's not how it felt. Searching and sorting, the workhorse tasks of programming, are experienced manually as routine, perhaps, but also holistic and irregular.

Looping is just branching backward, an alteration of sequence in conjunction with a condition, yet branching by itself does not account for the oddity. Our experience allows us to understand the past, as a respository of facts and situations, the facts and situations that got us here. Our experience allows us to understand branching on a condition, because either way guides us along a future path. But going back into the past to repeat identical acts in virually identical contexts is not consistent with our experience. And the detection of the first-time-through condition (in a loop) is more jarring. Why does that have to be tested all time? Why something so unnatural, when our experience gives us no trouble distinguishing the first occurrence from subsequent occurrences?

This kind of pondering invites analysis from a perspective outside of computationalism. Such a view is sometimes called "embodied cognition" or "embedded cognition" and sometimes expanded to embrace other aspects and given as 4E or 4EA—embodied, embedded, enactive, extended, and affective [Paine], that is, expanding the concept of mind to emcompass more than the brain under computation. (This observer prefers to consider 4EA and diverse other theories complementary to computationalism, insofar as allowed [Hill].)

Given a pile of items to work on, such as greeting cards to write, or reports to review, we process them according to a pattern, of course, but each document is different; our attention is drawn by that. The documents are the world, in which we are embedded. The pile (and the task) shrinks, and the contents participate in our cognition, because the process is enactive. We move things about, we look at the clock; the time changes. The mind is extended into the world. The changes involve more than the control variables, which are not, in fact, particularly salient. We can reach for the pile only so far, we get tired, because we are emodied. We get bored and cranky, or make a joke about the mind-numbing effect. That's affect.

While suggestive, this enumeration of rough parallels to 4EA is not spot-on. We computer scientists (and analytic philosophers) warm up to 4EA: It's discrete. It's a list. Cozy as it may be, such a theory, based on rejection of a robust view, lacks firm premises [Shapiro]. But we can formulate a twist on 4EA as an explanation of the iteration puzzle: Time is linear (in first-person experience). We can't back up. Our cognitive task is embedded, sure—not in the three physical dimensions, but the fourth. It's extended, sure, but extended in only one direction (in that dimension). In iterative tasks, we unspool the loops by executing the block successively in slightly different circumstances with different objects, each execution coming after the one before, but not overlaid on it. Whatever the data processing of our documents includes, we perform it once with the first document, then we perform it with the second document, and then with the third; it's like this sentence, in which there is no jump back to the beginning, but a narrative of actions following upon one another. The first time we perform the act, it is new, whereas subsequent times are familiar, that distinction sufficient to mark the initial performance and leave the later ones unmarked.

Time, however, is only incidentally about the body. Manzotti, in a critique of embodied cognition, suggests "em-world-ment" rather than embodiment [Manzotti], pointing the way to a broader notion of interactive cognition, perhaps broader even than 4EA. But I shrink from promoting a general theory of "en-time-ment", and not just because of the langauge abuse. This is an exercise in speculative application of a theory to a specific experience, not a proof of a general result. This author deplores the tendency to regard even a sketchy metaphor as a proof by analogy, which requires a great deal more rigorous thought. Meanwhile, I have to finish sorting those magazines.

References

[Paine] Rachel Paine. 2016. 4EA in 50 New Ideas. The Philosopher's Magazine 72:1st quarter.

[Hill] Robin K. Hill. 2021. Safe Space for Alt-Views. Blog@CACM. September 27, 2021.

[Manzotti] Riccardo Manzotti. 2019. Embodied AI beyond Embodied Cognition and Enactivism. Philosophies 2019, 4, 39; doi:10.3390/philosophies4030039.

[Shapiro] Lawrence Shapiro and Shannon Spaulding. 2021. Embodied Cognition. The Stanford Encyclopedia of Philosophy (Winter 2021 Edition), Edward N. Zalta (ed.). Not yet archived. Forthcoming URL given = https://plato.stanford.edu/archives/win2021/entries/embodied-cognition.

Robin K. Hill is a lecturer in the Department of Computer Science and an affiliate of both the Department of Philosophy and Religious Studies and the Wyoming Institute for Humanities Research at the University of Wyoming. She has been a member of ACM since 1978.

### Shape the Future of Computing

ACM encourages its members to take a direct hand in shaping the future of the association. There are more ways than ever to get involved.

Get Involved

### Communications of the ACM (CACM) is now a fully Open Access publication.

By opening CACM to the world, we hope to increase engagement among the broader computer science community and encourage non-members to discover the rich resources ACM has to offer.