We often like to point out that just because you’re not making a “digital” end-product doesn’t mean coding can’t be useful. This weekend I had a perfect example of that.

I’ve decided to build a nail violin to demonstrate at an event I’m running in April. Here’s a video of Bill Wesley, who is one of the only people in the world who makes and plays them:

This is an extremely low-tech thing. It’s a wooden box with nails hammered into it. That’s it. It was invented in the 18th century using technology that had already been around for hundreds of years. So this is in no sense a futuristic “digital project”.

When I came to make a prototype, though, I realised I wanted five rows of twelve nails each arranged in a segment of an ellipse, so I could use a violin bow on the outer row. (I thought this might make tuning the nails easier, which it didn’t).

Obviously I wasn’t going to do a good job of this by eye so I needed a template. But making one in Adobe Illustrator was a pain. Maybe an Illustrator guru would have known all the right tricks but it seemed fiddly and inflexible to me.

So I wrote some code in Processing to produce the exact pattern I wanted:

(Admittedly, this took about half an hour because the maths was surprisingly hard to get right — the standard parameterization of the ellipse doesn’t give you evenly-spaced dots because it doesn’t have uniform speed, and fixing that is yucky.)

Then I simply printed it, taped it to the box and punched through the dots with an awl:

After that of course I threw away my template and nobody need ever know about it. What’s more, I can adjust and adapt the code for different prototypes as I discover what works and what doesn’t — and if I want to I can produce much more complex designs than this with almost as much ease.

When we think of “learning programming” we maybe tend to think about big, daunting projects that show off a lot of technical skill. But coding is a handy tool that can help you solve all kinds of small problems, like a 21st century Swiss Army knife. Even if you don’t aim to become a hardcore programmer, being able to knock together a quick script is a great life skill.