What if I told you your grandmother was a programmer? And not just any programmer, but a master of loops, pattern recognition, and recursive systems!
When we think of programming, we usually picture glowing screens, cryptic lines of code, and the click of a keyboard. But what if programming has been happening quietly, and beautifully, in the hands of knitters and crocheters for centuries? I have often wondered why I love spending my quiet evenings creating hats, stuffed animals, and blankets, and not writing a computer program. I chose a career in software engineering because I love it...but why is it not my hobby?
At first glance, knitting and crocheting might seem like cozy hobbies or quaint crafts, far removed from the high-tech world of software development. But look closer, and you’ll find logic, structure, pattern, and iteration, the very same building blocks that make up computer code. Fiber artists follow complex sets of instructions, repeat loops, adapt patterns on the fly, and debug mistakes with skill and precision. Sounds familiar?
Knitting and crocheting aren’t just creative expressions; they’re tactile, embodied forms of programming. We’ll look at the surprising parallels between yarn and code and ask why these traditionally feminized practices have been overlooked in conversations about technology and intelligence. It's time to reframe the narrative: knitting is coding, and it's been here all along!
NEEDLES, NOTEBOOKS, AND NARROW DEFINITIONS
The myth goes like this: programming is a modern, highly technical activity born in the silicon womb of the late 20th century, best practiced by mathematically gifted individuals behind glowing screens.
But that view is shortsighted and historically inaccurate.
Knitting and crocheting are systems-based practices governed by rules, patterns, conditions, and structures. They require fluency in symbolic languages (yes, patterns are symbolic), long-term logic, spatial reasoning, error handling, and iterative thinking. In other words, they require programming skills.
When a fiber artist follows a pattern or designs one, they are not just “making something pretty”. They are building a system from scratch. Every stitch is a line of code; every row is a loop; every finished project is a running program, fully functional, and often wearable.
More provocatively, knitting and crocheting are not just "like" programming, they are programming. They involve abstraction, modularity, variables, and logical trees, just in a medium that society doesn’t associate with tech.
It’s time to debug our assumptions!
1. PATTERN VS. CODE
In both crafts and code, patterns are everything.
A knitting pattern might read:
A programmer might write:
These are not just similar, they’re structurally identical. A pattern is an algorithm for creating fabric. The only difference is that one runs on yarn and needles, the other on silicon.
2. LOOPS: LITERALLY
Programming has for loops and while loops. Knitting and crocheting? Also loops, actual loops, made of yarn.
But the metaphor goes deeper:
• A knit stitch is a loop.
• A crochet chain is a recursive series of linked loops.
• Nested loops are used to build shapes, textures, and lace.
Each row builds on the logic of the last. Make a mistake in Row 3, and Row 30 will pay the price. Debugging? Oh yes, every fiber artist has reverse-engineered their own sweater more times than they care to admit.
3. CONDITIONAL LOGIC AND VARIABLES
You think only coders use conditionals? Think again.
Patterns often say things like:
“If using chunky yarn, cast on 20 stitches. If using worsted, cast on 30.”
Or:
“Repeat pattern until piece measures 6 inches, then decrease every other row.”
These are if-else statements, driven by variables like yarn weight, gauge, or user preferences. It’s adaptive logic, not unlike responsive web design.
4. FUNCTIONS, SUBROUTINES, AND MODULAR THINKING
Ever seen this in a pattern?
“Work 6 rows in moss stitch. (See page 2 for instructions.)”
That’s a function call. The knitter is being told: “Call the mossStitch() function 6 times.”
Fiber artists are also modular thinkers. They reuse blocks, motifs, and swatches just like coders reuse functions and modules. Granny squares? That’s object-oriented design.
5. . DEBUGGING AND TESTING
Knitting a new pattern is test-driven development. You cast on (initiate), knit a few rows, stop, squint, curse, count, rip back three inches (debug), and try again. You run the pattern on your yarn, and if it doesn’t compile (i.e., fit), you refactor.
Sound familiar?
Okay, I think you get the point. Then why did I feel my hobby is not coding like my colleagues? Turns out, that this is history. Literally!
A LEGACY IGNORED
Despite the clear computational nature of fiber arts, knitting and crocheting have been excluded from the pantheon of “real” technical work. Why? Because of gender, economics, and historical gatekeeping.
In the 19th and 20th centuries, needlework was framed as "women's work", domestic, decorative, and inherently inferior to the rational, technical labor of men. This classification wasn't based on complexity or cognitive load, but on cultural values that dismissed anything associated with femininity as non-serious or non-intellectual.
But make no mistake: the same societies that dismissed knitters as housewives treated early computer programming as secretarial work and therefore gave it to women. When programming was low-status, it was female-dominated. Only when its prestige and pay rose did men push into the field, often rewriting history as they arrived. In the ’70s, scientists like Dijkstra made computer science mathematical and by extension, male dominated by claiming things like “the soft scientists make themselves even more ridiculous … by claiming that they can contribute to software engineering” and “‘hard’ computing: computing that is technically demanding, mathematical, formal”.
Knitting and crocheting, however, stayed in the domestic domain, and thus remained underestimated. The irony? Many knitters were already doing something as sophisticated as early programming, but without institutional support or professional title.
To this day, when we think of a “coder,” we rarely imagine someone with a crochet hook. If we reframe what “code” means, we begin to see that it’s not confined to JavaScript or Python. Code is any system of instructions that produces consistent, complex results through structure and logic. By that definition, knitting and crocheting are rich computational languages, ones you can hold, wear, and gift to others.
We need to recognize that this isn't just about elevating craft. It's about busting open the cultural walls that separate the technical from the domestic, the "hard" from the "soft," and the masculine from the feminine. It’s about acknowledging that logic lives in lace, algorithms reside in afghans, and that your grandma, if she knits, might have been writing recursive programs before it was cool.
So, let’s honor the coders in the knitting circles, the hackers with hooks, and the developers with double-pointed needles. They're not just crafting, they’re compiling beauty out of loops and logic!