Knitting as Programming

a knit octopus sweater in blue and white
Knit by Abbey Perini, pattern is Embrace Octopus Sweater by Maia E. Sirnes

The Beginning

a woman weaves wire to create core rope memory


A Knitting Primer

a diagram of K2P2 ribbing
K2P2 Ribbing

Patterns as Programming

  • Knitting pattern designers follow DRY.
  • Pattern repeats are for loops, typically surrounded by brackets, asterisks, or parentheses.
  • It’s common to see while loops like ‘until the end of the round’ or ‘to n stitches before marker’.
  • Higher level languages like Python and Javascript use symbols and keywords to tell the computer what the desired output is, just like knitting charts.
  • Like assembly languages, operands are pushed and popped onto the needles.
  • Patterns are tested and retested by users for correctness, scalability, and the look of the finished object (aka expected output).
  • Pattern developers prefer open source software (Darktable, Gimp, Libre, Stitchmastery, etc.).
  • Different placements of yarn and needles produce different outputs.
a lacey Dowland shawl knit in sparkly burgundy yarn
Knit by Abbey Perini, pattern by Dowland by Dee O’Keefe, yarn is Meeker Street by The Jewelry Box

Patterns as Regular Expressions

Patterns as Tools for Teaching Programming


Additional Fun

Additional Sources




…did someone say animated CSS button?

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

6 Advanced Python Decorator Patterns

✅Stellar is moving through a powerful ascending channel ‼️Price dropped down as it touched midline…

What it means to be a developer

My Experience At Guru’s Code Camp 2020.

Complete Push notification guide using FCM, node server and service workers in client side…

Algorithms: First Unique Character in a String

Easiest and fastest way to schedule jobs in Python

PART — II ***Memory Management — Evaluation(iOS) Objective C to Swift -Reference Type and Value…

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Abbey Perini

Abbey Perini

…did someone say animated CSS button?

More from Medium

Static Library: The importance of your personal coding Library of Alexandria

Moving away from the Mouse + Keyboard + GUI interface

ZBook Studio G8 — My first experience with my Z by HP hardware

How to Integrate SAWO SDK to your Vue code.