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.