In this paper we investigate the relations between knitting and computer science. We show that the two disciplines share many concepts. Computer science, in particular algorithm theory, can suggest a lot of powerful tools that can be used both in descriptive and prescriptive ways and that apparently have not yet been used for creative knitting. The obtained results are short (optimal size) recursive descriptions for complex patterns; creation of new complex recursive patterns; and the application of three-valued algebra operations to combine and create a wide variety of new patterns.