Heuristic code construction methods