What Alan Turing was deciphering were cyphers - they worked to a system, which was very complicated and changed daily, but followed patterns. Once a German sender made a mistake and used a keyword which could be identified, the way the patterns worked could be deduced and future messages deciphered.
A code replaces whole chunks, sentences and ideas with something known only to the sender and receiver. Perhaps the details of a strike are worked out in person between conspirators, and only the place and time not fixed. They could have a known substitute for NY or London, and for the date, and just send that at the last minute. The unpredictabilty and the human factor make it difficult for a computer programme to reproduce, they can only do what the programmers design in.