essaysLearning in Public 1 min

How I Finally Tamed Recursion (and Survived My Family Tree)

Picture this: You're at the annual family gathering, trapped in an endless loop of cheek-pinches and 'So, what are you really doing with your life?' That, my friend, is recursion.

By MoAfrika Skotch Ntilane · 11 April 2025

Learning in Public

How I Finally Tamed Recursion (and Survived My Family Tree)

By MoAfrika Skotch Ntilane — 11 April 2025

Picture this: You're at the annual family gathering, trapped in an endless loop of cheek-pinches and "So, what are you really doing with your life?" Each relative hands you off to the next, each interrogation a slight variation of the last. Sound familiar? That, my friend, is recursion, a concept I first learned in JavaScript, and a metaphor I wish I had discovered before my first Grade 5 reunion.

Recursion: The Family Reunion of Programming

Recursion is elegant in code, but brutal in the wild... especially when the wild is your own family. Each function calls itself to solve a smaller part of a bigger problem, and you learn quickly: without a stopping condition, the loop is infinite, the system crashes, and somewhere in the basement, the metaphorical spaghetti of your sanity untangles in slow motion.

The Two Pillars of Recursive Survival

  • Base Case: Your escape clause, the condition that halts the recursion. Spotting the dessert table and making a beeline is the literal and figurative base case.
  • Recursive Case: Where the function calls itself with modified input. Aunt Mildred passes you to Cousin Themba, who passes you to Uncle Sipho, who returns you to Aunt Mildred.

Recursion, like family, is messy, beautiful, and infinitely instructive. And now, if you'll excuse me, I need to console.log my way out of this reunion, one carefully flattened branch at a time.

Leave a reflection

How did this land?

Idea trail

If this resonated, read these next

The Slow Letter

Read at the pace
life actually moves.

One newsletter, sent when there is something worth saying. Pick the rhythms that suit you — nothing more, nothing louder.

No popups. No selling your address. Unsubscribe in one click.