Get email delivery of the Cadence blog featured here
I learned how to knit only about a dozen years ago, and it quickly became an obsession. I can’t even begin to guess at the number of scarves, blankets, sweaters, socks, baby things, and stuffed animals I have created since then. I have made lace, learned Fair Isle, tangled cables, loved color knitting, hated intarsia, figured out short rows, and started measuring my stash of yarn in marathons (one marathon is 26.2 miles, so 46,112 yards is a marathon of yarn). (I do NOT have a yarn problem. I just have a problem figuring out where to store it.) I have sold some of my creations, but I never know how much to charge; a single sock consists of about 10,500 stitches, and I can knit about one stitch every two seconds—so if I paid myself California minimum wage, one sock would cost about $125, not counting materials and Hofstadter’s Law*. Who would say that a cool $300 is a reasonable price for a pair of socks? But I digress.
The first thing you learn when knitting is how to do a knit stitch: you make a loop around a stick, and pull a second loop from the back to the front, transferring the loop from one stick to the other. And then you do it again about forty bajillion times, switching the needles when you get to the end of the row. (This is called the “garter stitch”, and the resulting fabric looks like the orange example. It’s stretchy and warm and is good for scarves and blankets.)
But look at your nearest knitted clothing item (check your socks)—notice how each stitch looks like little V’s, all lined up in a row? You need to learn another kind of stitch to make that, which is the second thing you learn when knitting: the purl stitch is the same as the knit stitch, except instead of pulling the second loop from back to front, you pull the loop from the front to the back.
So now you alternate rows: knit one row, and when you get to the end, switch needles, and purl the next row. The resulting fabric is called “stockinette”, and on the “right” side it looks like the tidy little V’s, and on the “wrong” side it looks a little nubbly and horizontal (pale blue and beige, respectively).
And now you know everything you need to know to make anything. No kidding. Alternate knitting and purling with the stitches lined up? You get ribbing (the red example). Twist the ribs up, and you get cables! Knit three stitches and purl three stitches every third row? You get the seed stitch (the navy example)! Mix it up and make zigzags (the green example)!
Your pattern depends on the number of purls and knits, how they are placed next to each other or twisted up, how often and in what sequence things are repeated, where to start, and when to stop (and this may be when your spouse tells you that the closet is too full of yarn and you need to clear it out).
Reading a knitting pattern isn’t like reading a book, however; you can’t read some combination of “knit” and “purl” 10,000 times and then voilà you have a sock. So how do we describe the pattern? Hmm, it’s a bunch of ones and zeros… what else do we know that is binary…
When electrical engineering professor Dr. Karen Shoop of Queen Mary University in London took her first knitting workshop, she noticed that knitting is very like writing computer code. “I noticed that knitting instructions are largely binary (like computers) – in other words, knit or purl,” she says. “More interesting were the knitting instructions, which read just like regular expressions [of code], used for string matching and manipulation when coding.” Shoop also recognizes the earliest stages of computing were inspired by handwork: “Of course, computers ultimately started off partially inspired by weaving and the Jacquard loom, or earlier Bouchon’s loom. Arguably some of the earliest programmers were the people making the card/paper punch hole patterns for weaving patterns.”
Regular expressions are used in both knitting and coding to read patterns. Dr. Shoop uses the example of the instructions for a “ribbed” pattern (that is, the kind of pattern on the cuffs of sweaters or socks, see the red example). In knitting notation (assuming an even number of stitches), the pattern may appear as:
Row 1: *k1, p1; rep from * 10 timesRows 2: *p1, k1; rep from * 10 times
Row 1: (K1, P1) rep to endRow 2: (P1, K1) rep to end
Repeat these 2 rows for length desired.
Using coding’s regular expressions, and if knit = k and purl = p, the knitting notation above turns into something like:
“Students often feel anything to do with computing (especially coding) is in a separate bubble,” Dr. Shoop says, “and I want... to show that we code in our outside world.”
So many directions we could go when thinking about this. I've been thinking about this a lot for the last couple of weeks. As ever, I spent a disproportionate amount of time researching knitting and coding, and then getting overwhelmed by so much interesting stuff out there!
Without making any broad sweeping generalizations about the ways men and women think and then drawing questionable conclusions about men and women having inherently different ways of thinking, I can say this: working with the hands and using instructional patterns can help kids develop critical thinking skills—spatial thinking, logic and algebraic functions, geometric thinking, even art—as well as honing their fine motor skills. These skills are vitally important in education. I wonder whether this kind of “handwork” (like knitting, woodworking, metallurgy, needlework, pottery, etc.) would be a way to bring more girls to STEM fields (and for more men to become knitters). Seems like a good basis for some longitudinal studies to determine whether there is a connection between the two.
Stay tuned for more thoughts about how a raven is like a writing desk I mean, how knitting can be a code, and how different people think differently... I'm also interested in any comments you may have on this line of thinking!
P.S. I hope to see you at DAC in Austin! I'll be the one surreptitiously knitting in any nook I can find...
* Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law. The recursive nature of the law is a reflection of the widely experienced difficulty of estimating complex tasks despite all best efforts, including knowing that the task is complex.
I found another topic that relates directly to knitting and code -- in this case, espionage! There are a number of articles out there, but here are some good ones. Enjoy!