A law is a written dictate of a rule of conduct for members of a society. Certain punishments are assigned to the failure of an individual to follow a law, as well. A code is an unwritten set of conventional expectations or principles that members of a group, such as a society, are to follow. [freedictionary.com]
In some societies a social code is often more powerful than the law. For instance, Shirley Jackson's short story, "The Lottery," demonstrates the power of the social code over the law. The victim of the lottery, Tessie Hutchinson, points to the unfairness of the custom of her village, but no one pays attention to her legal point. Certainly, in Maycomb, Alabama, the code of conduct assigned to blacks and whites is a very strong set of expectations, a code, that when broken, has serious repercussions. For example, when Mr. Dolphus Raymond goes to live with blacks and has chidren by a black woman, he is ostracized by society. That this code is more powerful than the law of the state is exemplified by Mayella Ewell: Having broken the racial code by "kissing a Negro" she is willing to perjure herself in a court of law and risk imprisonment and fines by accusing Tom Robinson of rape rather than to admit to what she has done. Of Mayella, Atticus Finch says in his summation to the jury,
...she [Mayella] has merely broken a rigid and time-honored code of our society, a code so severe that shoever breaks it is hounded from our midst as unfit to live with....She knew full well the enormity of her offense, but because her desires were stronger than the code she was breaking, she persisted in breaking it....
[To defer the dire consequences of the breaking of this code, Mayella] "struck out at her victim--of necessity she must put him away from her...She must destroy the evidence of her offense.
Indeed, in Macomb, the social code regarding the association of the races is much stronger than any law.