A code is usually a set of rules or protocols to be followed so that you can meet a certain standard. For instance, a code may say that employees will wear gloves at all times when handling merchandise on the assembly line.
The standard is that the product will have no unnecessary ridges, smudges, etc. The code insures the standard. Often a standard is set, and a code is devised to meet that standard. In other cases, a code is developed to determine what standard can be reach. The code is the means. The standard represents the qualities that are expected for the product, job performance, etc.