There was a talk at a Linux conference a while back relating knitting to programming and I’ve yet to watch it because the audio on YT wasn’t great but it’s on my list.
I find knitting very soothing, and it also scratches the same itch as programming.
Old looms could make patterns and it's considered by many that the way to "encode" those different patterns was actually an early of programming.