In scientific nomenclature, a synonym is a scientific name that applies to a taxon that (now) goes by a different scientific name, although the term is used somewhat differently in the zoological code of nomenclature. For example, Linnaeus was the first to give a scientific name (under the currently used system of scientific nomenclature) to the Norway spruce, which he called Pinus abies. This name is no longer in use: it is now a synonym of the current scientific name which is Picea abies.
Unlike synonyms in other contexts, in taxonomy a synonym is not interchangeable with the name of which it is a synonym. In taxonomy, synonyms are not equals, but have a different status. For any taxon with a particular circumscription, position, and rank, only one scientific name is considered to be the correct one at any given time (this correct name is to be determined by applying the relevant code of nomenclature). A synonym cannot exist in isolation: it is always an alternative to a different scientific name. Given that the correct name of a taxon depends on the taxonomic viewpoint used (resulting in a particular circumscription, position and rank) a name that is one taxonomist's synonym may be another taxonomist's correct name (and vice versa).
Synonyms may arise whenever the same taxon is described and named more than once, independently. They may also arise when existing taxa are changed, as when two taxa are joined to become one, a species is moved to a different genus, a variety is moved to a different species, etc. Synonyms also come about when the codes of nomenclature change, so that older names are no longer acceptable; for example, Erica herbacea L.. has been rejected in favour of Erica carnea L. and is thus its synonym.
To the general user of scientific names, in fields such as agriculture, horticulture, ecology, general science, etc., a synonym is a name that was previously used as the correct scientific name (in handbooks and similar sources) but which has been displaced by another scientific name, which is now regarded as correct. Thus Oxford Dictionaries Online defines the term as "a taxonomic name which has the same application as another, especially one which has been superseded and is no longer valid." In handbooks and general texts, it is useful to have synonyms mentioned as such after the current scientific name, so as to avoid confusion. For example, if the much advertised name change should go through and the scientific name of the fruit fly were changed to Sophophora melanogaster, it would be very helpful if any mention of this name was accompanied by "(syn. Drosophila melanogaster)". Synonyms used in this way may not always meet the strict definitions of the term "synonym" in the formal rules of nomenclature which govern scientific names (see below).