* The hero is always a white man. In the vast majority of Western films, the hero is a white man. This reflects the historical reality that the American West was largely settled by white people, and that white people were often the ones who held positions of power and authority in Western societies.
* The hero is a lone wolf. Western heroes are often loners, who ride into town on their own and take on whatever challenges they find. This reflects the idea of the American frontier as a place of individualism and self-reliance.
* The hero is always victorious. Western heroes always come out on top in the end, no matter how difficult the odds may be. This reflects the American ideal of overcoming adversity and achieving success.
* The villain is always a bad guy. Western villains are often mustache-twirling evil incarnate, who are motivated by greed, power, or revenge. This makes it easy for the audience to root for the hero and want him to defeat the villain.
* The setting is always the American West. Western films are set in the American West, specifically in the 19th century. This setting allows for a number of iconic images, such as cowboys, horses, saloons, and shootouts.
* The music is always country. Western films often feature country music, which helps to create a sense of atmosphere and authenticity. Country music is also often used to score the action sequences, and to provide a sense of emotion.
These are just some of the most common codes and conventions that can be found in Western films. These codes and conventions have helped to define the genre and make it one of the most popular genres in film history.