fbpx
Wikipedia

Name collision

In computer programming, a name collision is the nomenclature problem that occurs when the same variable name is used for different things in two separate areas that are joined, merged, or otherwise go from occupying separate namespaces to sharing one. As with the collision of other identifiers, it must be resolved in some way[a] for the new software (such as a mashup) to work right.[1] Problems of name collision, and methods to avoid them, are a common issue in an introductory level analysis of computer languages, such as for C++.[1]

History edit

The term "name collision" has been used in computer science for more than three decades, when referring to names in various classification systems.[2]

Avoiding name collisions edit

There are several techniques for avoiding name collisions, including the use of:

  • namespaces - to qualify each name within a separate name group, so that the totally qualified names differ from each other.[1]
  • renaming - to change the name of one item (typically the one used less often) into some other name.
  • prefixing - putting unique characters before the names so that the names differ and further name collisions are unlikely to happen by accident.

See also edit

Notes edit

References edit

  1. ^ a b c "Getting Started" (lesson for C++), Brown University, Computer Science Dept., January 2000 (in text as "Jan 2000"), pages 5-6, webpage (PDF): CS-Brown-Cpp.
  2. ^ "Name collision in multiple classification hierarchies", Portal ACM (Association for Computing Machinery), by J.L. Knudsen, 1988, webpage: Portal-ACM-607.


name, collision, other, uses, name, conflict, computer, programming, name, collision, nomenclature, problem, that, occurs, when, same, variable, name, used, different, things, separate, areas, that, joined, merged, otherwise, from, occupying, separate, namespa. For other uses see Name conflict In computer programming a name collision is the nomenclature problem that occurs when the same variable name is used for different things in two separate areas that are joined merged or otherwise go from occupying separate namespaces to sharing one As with the collision of other identifiers it must be resolved in some way a for the new software such as a mashup to work right 1 Problems of name collision and methods to avoid them are a common issue in an introductory level analysis of computer languages such as for C 1 Contents 1 History 2 Avoiding name collisions 3 See also 4 Notes 5 ReferencesHistory editThe term name collision has been used in computer science for more than three decades when referring to names in various classification systems 2 Avoiding name collisions editThere are several techniques for avoiding name collisions including the use of namespaces to qualify each name within a separate name group so that the totally qualified names differ from each other 1 renaming to change the name of one item typically the one used less often into some other name prefixing putting unique characters before the names so that the names differ and further name collisions are unlikely to happen by accident See also editlocal variables variable data items that are local to a module Name mangling Naming collisionNotes edit see hash table Collision resolution for detailsReferences edit a b c Getting Started lesson for C Brown University Computer Science Dept January 2000 in text as Jan 2000 pages 5 6 webpage PDF CS Brown Cpp Name collision in multiple classification hierarchies Portal ACM Association for Computing Machinery by J L Knudsen 1988 webpage Portal ACM 607 nbsp This programming language related article is a stub You can help Wikipedia by expanding it vte Retrieved from https en wikipedia org w index php title Name collision amp oldid 1121742706, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.