A production code number, also known as the production code (PC) or episode code is an alphanumeric designation used to uniquely identify episodes within a television series. It is also broadly used for other identification purposes where a unique production number is desirable; for example, automobile manufacturers use production numbers as part of the vehicle identification number. But since each studio can freely generate its own PC format, it cannot be used universally to identify the show and episode.
While, in general, television episodes are filmed in the order they are intended to be aired in, there are circumstances in which this is not the case. In these instances, the production codes can be useful in determining the writers' original intentions.
Some "stand-alone" shows, such as The Simpsons, Law & Order or SpongeBob SquarePants, may air episodes in radically different order to how they are produced, because character development and continuity are not major aspects of production. The airing order may in the end be decided by the network, based on ratings, sweeps months, or other networks' competition.
Other, more serialized series, like Desperate Housewives, will air all of their episodes in order.
In some rare cases, shows will film episodes out of order to accommodate guest stars' schedules, or to work around main stars' movie schedules. A good example of this is The X-Files, which filmed episodes out of order in its fifth and sixth seasons to accommodate the shooting schedules of main stars Gillian Anderson and David Duchovny.