Why Coding is like Crochet

People are sometimes surprised to find that, despite my day job, I also love knitting and crochet.

Perhaps it’s because coding is often seen as the preserve of long-haired teenagers with death metal T-shirts, while knitting is for little old ladies in rocking chairs.

Or because one is assumed to be ‘scientific’ while the other is ‘creative’.

However, to me, knitting and coding have lots in common. Let me explain…

1. You end up with something beautiful or useful (or both!)

It’s fairly obvious that a good knitter or crocheter (is that a real word?) can create beautiful things: perhaps a jumper, a shawl, a child’s toy or a bag. A friend of mine even covered an entire chair with a crochet cottage and garden!

Most people don’t think of code itself as being beautiful, but the output can be amazing. Just think of all the things you use every day which depend on code: your phone, your favourite online shop, even your washing machine and car. They all do what they do because someone wrote some carefully-crafted code which does exactly what it needs to do.

2. There’s always something new to learn.

Rear view of a young girl with long blonde hair wearing a vibrantly coloured knitted hat. The hat is knitted entrelac style, with the coloured sections criss-crossing one another in different directions..
Entrelac hat (yes, I actually made this)

My mother taught me to knit when I was about eight years old. I probably typed my first lines of code, diligently copied from a computer magazine, at around the same time.

Yet, despite the fact that I’ve been coding and knitting on-and-off for over 30 years, I’m still learning all the time. It’s one of the things I love most about my job. And the same is true of my hobby.

Over the last few years I’ve learned how to knit entrelac, how to crochet amigurumi animals and how to turn the heel of a sock. I’ve also learned how to create WordPress themes and plugins from scratch, how to build a responsive menu using JavaScript, and how to write SQL queries.

And if all that sounds like gobbledegook, well, that brings me nicely onto my next point:

3. Jargon

The world of web development is well-known for being full of jargon and mysterious acronyms, from coding languages like PHP, HTML and CSS to online marketing terms like SEO, PPC and CTA.

However, non-knitters/crocheters may be surprised at the number of apparently incomprehensible phrases and abbreviations there too. It starts with a simple K1 P1, but before you know it, you’re discussing whether or not to frog your latest WIP, or trying to remember whether you’re meant to be doing DC or HDC.

I’m sure you’re desperate to know what all that means, so here’s a quick translation – or you can skip to the next point.

  • PHP – a programming language. The initials no longer mean anything helpful but the name remains.
  • HTML – HyperText Mark-up Language, the code behind all web pages.
  • CSS – Cascading Style Sheet, used to contain all the information about the design of a website.
  • SEOSearch Engine Optimisation.
  • PPC – Pay Per Click, a type of online advertising, where the cost depends on the number of people who click an advert.
  • CTA – Call To Action, a term used to describe any part of a website which encourages a visitor to actually do something.
  • K1P1 – Knit one stitch, Purl one stitch.
  • Frog – undo your knitting or crochet work. It’s so called because, as you pull out the stitches, you have to “rip it, rip it” (ribbit, ribbit).
  • WIP – Work In Progress. This isn’t solely a knitting/crochet term, but it does get used a lot in this context. Most crafters will have several WIPs on the go at once.
  • DCDouble Crochet stitch. Just to be extra confusing, a DC in the UK is different to a DC in the USA.
  • HDCHalf Double Crochet stitch. You’d think that ‘half double’ would be a ‘single’ crochet stitch but actually it’s mid-way between a single crochet and double crochet stitch (and again, different in the UK and USA).

4. Enthusiasts are really generous

While some code, and some knitting patterns/techniques are closely-guarded secrets, there’s a whole ‘open source’ community for both disciplines, where people actively share and encourage others to follow their lead.

If you search YouTube for ‘learn crochet’ you’ll find about 300,000 videos. Even a search for something specific like ‘double crochet’ (that’s a type of stitch) will produce a similar number. Search for ‘learn JavaScript’ and you’ll find over 3 million videos!

There are hundreds, maybe thousands, of people who have taken the time to make videos to share their knowledge to help others. There are crafters who blog in detail about their creations, and spent hours carefully creating patterns, only to give them away free – and there are developers who do the same for their code and techniques.

Both online and offline, developers and knitters want to share their passion and help others to improve.

5. Just when you think it’s over… it’s not.

Don’t you love that feeling when you’ve finished something? And doesn’t your heart sink when you realise that it’s not quite finished, as there’s a boring bit you need to do first.

Someone once said to me that the difference between ‘home-made’ and ‘hand-made’ crafts is the finish: something home-made might be a little bit misshaped or have the odd thread hanging off, whereas something hand-made is clearly individual, but perfectly finished.

I understand that. But it’s also my least favourite bit of knitting and crochet. Having done all the fun stitching, the last thing I want to do is spend hours sewing in all the loose ends of threads, and ‘blocking’ the work, which involves damping it and carefully stretching it into exactly the shape its meant to be, thus smoothing out any slight variations in tension. Inwardly I’m ranting “But the thing is done! Why isn’t it over? Why do I have all this tedious painstaking work still to do?”

Similarly, when I’m coding a WordPress theme, for example (that’s a bunch of code which contains all the design information for a WordPress website), I’ll get to the point where it feels finished – but then I’ll have to do lots of testing. I’ll check it on a range of different browsers, because each one works slightly differently, and run it through various debugging and checking tools to make sure it looks good to computers as well as to me. I don’t mind this quite as much but, like sewing in ends and blocking, it’s still not as fun as the ‘making’ part.

6. If you don’t make notes, you’ll regret it later.

Sometimes I make up a knitting or crochet pattern as I go along. More often, I improvise in the middle of someone else’s pattern. Perhaps I’ll decide that I want to add a teeny bit of tapering in the middle of a sock so it fits snugly round my instep, or that I want to shorten a toy animal’s legs, or only want three repeats of a pattern instead of four.

The first few times I did this, I didn’t write down the changes, After all, how hard would it be to remember what I’d done? But invariably, after I’d put the work down for a few days, or by the time I’d reached the same point on the second sock or leg, I’d forgotten whether I did the decrease on row 12 or 13, and whether I’d reduced it by five rows or ten. And then I’d have to do lots of careful counting to work out exactly what I did.

On one occasion, I put some crochet away for a while and by the time I got it out again, I didn’t even know what sized hook I had used!

I’ve learned my lesson now. Most of the time, anyway…

Similarly, with coding, it’s easy to assume that you’ll remember what each little bit of code does. After all, you can just read the code and see, can’t you? But it’s so much easier if you don’t have to. I’ve spent long enough scratching my head as I pore through reams of code to know that an occasional well-placed comment can make a huge difference.

As an aside, I also get a bit of a warm glow from knowing that if someone else ever needs to use or adapt my code, they won’t have to spend hours working it all out first – there are little helpful hints all the way through.

7. They’re both scientific. And both creative.

Remember earlier I said that some people regard coding as scientific, and crochet as creative? I think that understates both skills: they are both scientific AND creative.

Yarn crafters themselves often don’t recognise that crochet and knitting patterns involve huge amounts of maths and logic.

And coders sometimes don’t realise that, as the WordPress tagline so succinctly reminds us, “Code is Poetry”.

But whether creating code, or creating a knitting pattern, the process is remarkably similar: you have to break down what you want into little parts, work out how each part is built, and carefully join them together to make the result.

The artistry is in how you do that.

And what about the differences?

Of course there are many, many differences. But the main ones for me are:
1) I can’t code in front of the telly (but I can crochet).
2) I don’t (yet?) have a group of friends who want to meet up in the pub every week to write code!

Want more blog posts?

Subscribe to get my latest blog posts straight to your inbox

Comments

  1. says

    Yes yes yes! I am a programmer by trade and a crocheter by night. So many things are similar, and yet programmers are often surprised I crochet, and my sewing/crochet circle are often surprised I program. Why is that?

    • Alice Gardiner says

      Hooray! A fellow coder/crocheter 🙂

      I wish I knew why these stereotypes still exist. I mean, surely it’s no more surprising that a coder should crochet than that a banker can be an amateur photographer? Mind you, I think I’d probably raise an eyebrow if my lawyer told me she was a DJ, so perhaps I’m just as guilty of making assumptions!

      BTW, I love your graphgan tool (another example of the ‘beautiful and useful’ stuff I was talking about). I haven’t tried a C2C yet but it’s on my ‘one day’ list…

  2. says

    I knit.
    I have a wandering eye for crochet, maybe even embroidery.
    I will happily go to a pub and code with you (and others). Will travel.

    • Alice Gardiner says

      I might have guessed!

      It’s a bit of a trek out here, but you’re welcome to come and visit (for coding, knitting and/or pub-visiting…)

  3. says

    Interesting article. As a one time hobby coder (BBC Basic & Visual Basic and HTML) I know that I use lots of maths when planning my crochet creations. Now my daughter codes at work and home but can I get her interested in crochet? – no!!

    • Alice Gardiner says

      My daughters both enjoy crochet, but my older one definitely prefers coding. Perhaps I should get her to read my post? 😉

    • says

      As the aforementioned daughter(!) I should point out that the similarities are not lost on me. That being technical and creative are not mutually exclusive is, after all, the premise of my blog.
      But as some one with too many hobbies already, who prefers the more intangible arts (poetry, theatre, singing) I’m quite happy to leave the crochet to my mother.

      • Alice Gardiner says

        I can absolutely understand the ‘too many hobbies’ thing! There are so many things I’d love to try… if only I had time.
        I’ve had a quick peek at your blog, which (naturally) appeals to me very much – and I can’t help noticing quite a few similarities with my own daughter, who’s also fanatical about poetry, singing and acting. Perhaps it’s a trait of the offspring of crocheting coders?!

  4. Margaret (Daisy) Lerner says

    I was a SAS (statistical analysis system) programmer for 25 years … and i quilt and i knit!
    here’s what i discovered about programming, quilting, and knitting: all 3 require that you use both your analytical and creative talents (left and right brain) to get from the beginning of the task to the targeted result. my reputation in my work field was based on my ability to accomplish complex tasks in a creative and effective manner. similarly, i am able to create my own knit patterns by imagining (creative) a finished product and then working out (analytical) the process and actually making it. the part of writing it down so others can follow can be both challenging and fun.
    regards,

    • Alice Gardiner says

      Oh wow, I’ve always wanted to quilt! I’ve never quite got round to trying it, but I must try to tackle that soon, as I do love the beautiful – and mathematical – patterns that you quilters can create.

      I’m also really pleased to hear that your creative skill was recognised in your workplace. I think it’s something that’s very often overlooked by employers who just want a result and don’t mind so much about how well code is put together… yet, as programmers, we know (or worry) that there’s a good chance it’ll mean more work in the long run if it’s carelessly done.

  5. says

    My favourite thing about knitting is that it lets me use maths in a practical way – I love it! You are so right about making notes, too. I’m glad I’m not the only one who can forget something that’s so obvious to my past self!