Deriving the Aho-Corasick algorithms : a case study into the synergy of programming methods