LibraryArts & CraftsKnittingPart 0: Start here: five short questions
KNT-00.05Is knitting a kind of computer code?
Short answer: In a way, yes. A knitting pattern is a program: two basic operations (knit and purl, like 1 and 0), loops (repeats), conditions ("if the row is even") and variables (stitch counts). Knitters "execute" the code with their hands. During the World Wars, there were even stories of spies hiding messages in knitting.
Patterns as programs
- Binary: knit and purl can encode letters, like 0 and 1.
- Loops: "repeat from * to the end".
- Charts: grids like pixel images or matrices.
- Errors: a missed stitch is a bug; "frogging" (ripping out) is debugging.
History and research
- Jacquard's punched cards (1804) for looms inspired Babbage and Lovelace's computing ideas (TEC-12.2).
- Wartime stories: knitters in occupied Belgium are said to have watched trains and recorded them in stitches; Britain's censors reportedly banned posting knitting patterns abroad in case they hid codes.
- Mathematics: knots, topology and hyperbolic surfaces are studied with knitting; MIT and other researchers have built software that writes knitting-machine programs.
Remember this: Every knitter is a programmer with yarn.
Tip: the ← and → keys also turn the pages.
