The Horace method for error-correcting codes