All Topics  
Identifier

 

   Email Print
   Bookmark   Link






 

Identifier



 
 
In computer science
Computer science

Computer science is the study of the theoretical foundations of information and computation, and of practical techniques for their implementation and application in computer systems....
, Identifiers (IDs) are lexical
Lexical (semiotics)

In the lexicon of a language, lexical words or nouns refer to things. These words fall into three main classes:*proper nouns refer exclusively to the place, object or person named, i.e....
 tokens that name entities
Entity

An entity is something that has a distinct, separate existence, though it need not be a material existence. In particular, abstractions and legal fictions are usually regarded as entities....
. The concept is analogous
Analogy

Analogy is both the cognition process of transferring information from a particular subject to another particular subject , and a language expression corresponding to such a process....
 to that of a "name
Name

A name is a label for a noun, , normally used to distinguish one from another. Names can identify a class or Category of things, or a single thing, either uniquely, or within a given wiktionary:context....
". Identifiers are used extensively in virtually all information processing systems. Naming entities makes it possible to refer to them, which is essential for any kind of symbolic processing.

Identifiers in computer languages
In computer languages, identifiers are tokens (also called symbol
Symbol

A symbol is something such as an entity, picture, written word, sound, or particular mark that represents something else by association, resemblance, or convention....
s) which name language entities.






Discussion
Ask a question about 'Identifier'
Start a new discussion about 'Identifier'
Answer questions from other users
Full Discussion Forum



Encyclopedia


In computer science
Computer science

Computer science is the study of the theoretical foundations of information and computation, and of practical techniques for their implementation and application in computer systems....
, Identifiers (IDs) are lexical
Lexical (semiotics)

In the lexicon of a language, lexical words or nouns refer to things. These words fall into three main classes:*proper nouns refer exclusively to the place, object or person named, i.e....
 tokens that name entities
Entity

An entity is something that has a distinct, separate existence, though it need not be a material existence. In particular, abstractions and legal fictions are usually regarded as entities....
. The concept is analogous
Analogy

Analogy is both the cognition process of transferring information from a particular subject to another particular subject , and a language expression corresponding to such a process....
 to that of a "name
Name

A name is a label for a noun, , normally used to distinguish one from another. Names can identify a class or Category of things, or a single thing, either uniquely, or within a given wiktionary:context....
". Identifiers are used extensively in virtually all information processing systems. Naming entities makes it possible to refer to them, which is essential for any kind of symbolic processing.

Identifiers in computer languages


In computer languages, identifiers are tokens (also called symbol
Symbol

A symbol is something such as an entity, picture, written word, sound, or particular mark that represents something else by association, resemblance, or convention....
s) which name language entities. Some of the kinds of entities an identifier might denote include variable
Variable

A variable is a symbol that stands for a value that may vary; the term usually occurs in opposition to constant, which is a symbol for a non-varying value, i.e....
s, types, label
Label (programming language)

A label in a programming language is a sequence of characters that identifies a location within source code. In most languages labels take the form of an identifier, often followed by a punctuation ....
s, subroutine
Subroutine

In computer science, a subroutine or subprogram is a portion of computer code within a larger computer program, which performs a specific task and is relatively independent of the remaining code....
s, and package
Software package (programming)

A software package is used in object-oriented programming to name a group of related class es of a program. Packages are useful to measure and control the inherent coupling of a program....
s.

In most languages some character sequences have the lexical form of an identifier but are known as keywords
Keyword (computer programming)

In computer programming, a keyword is a word or identifier that has a particular meaning to the programming language. The meaning of keywords ? and, indeed, the meaning of the notion of keyword ? differs widely from language to language....
. In a few languages, eg, PL/1, the distinction is not clear cut.

Computer languages usually place restrictions on what characters may appear in an identifier. For example, in early versions the C
C (programming language)

C is a general-purpose computer programming language originally developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories to implement the Unix operating system....
 and C++
C++

C++ is a general-purpose programming language. It is regarded as a middle-level language, as it comprises a combination of both high-level programming language and low-level programming language language features....
 language, identifiers are restricted to being a sequence of one or more ASCII
ASCII

American Standard Code for Information Interchange , is a coding standard that can be used for interchanging information, if the information is expressed mainly by the written form of English words....
 letters, digits (these may not appear as the first character), and underscores. Later versions of these languages, along with many other modern languages support almost all Unicode
Unicode

Unicode is a computing industry standard allowing computers to consistently represent and manipulate Character expressed in most of the world's writing systems....
 characters in an identifier (a common restriction is not to permit white space characters and language operators).

In compiled programming languages, identifiers are generally compile time
Compile time

In computer science, compile time refers to either the operations performed by a compiler , programming language requirements that must be met by source code for it to be successfully compiled , or properties of the program that can be reasoned about at compile time....
 entities. That is, at runtime
Runtime

In computer science, runtime or run time describes the operation of a computer program, the duration of its execution, from beginning to termination ....
 the compiled program contains references to memory addresses and offsets rather than the textual identifier tokens (these memory addresses, or offsets, having been assigned by the compiler to each identifier).

In interpreted language
Interpreted language

In computer programming an interpreted language is a programming language whose implementation often takes the form of an interpreter . Theoretically, any language may be compiler or interpreted, so this designation is applied purely because of common implementation practice and not some underlying property of a language....
s identifiers are often present at runtime, sometimes even as first-class object
First-class object

In computing, a first-class object , in the context of a particular programming language, is an entity which can be used in programs without restriction ....
s which can be freely manipulated and evaluated. In Lisp, these are called symbols.

Compilers and interpreters do not usually assign any semantic meaning to an identifier based on the actual character sequence used. However, there are exceptions. For example:
  • in Perl
    Perl

    In computer programming, Perl is a high-level programming language, List of programming languages by category, Interpreter , dynamic programming language....
     a variable is indicated using a prefix called a sigil
    Sigil (computer programming)

    In computer programming, a sigil is a symbol attached to a variable name, showing the variable's datatype or Scope . The term was first applied to Perl usage by Philip Gwyn in 1999 to replace the more cumbersome "funny character in front of a variable name"....
    , which specifies aspects of how the variable is interpreted in expressions
    Expression (programming)

    An expression in a programming language is a combination of value s, variables, operator s, and function s that are interpreted according to the particular Order of operations and of association for a particular programming language, which computes and then produces another value....
    .
  • in Ruby a variable is automatically considered immutable
    Immutable object

    In object-oriented computer programming and Functional_programming programming, an immutable object is an object whose state cannot be modified after it is created....
     if its identifier starts with a capital letter;
  • in Fortran
    Fortran

    Fortran is a general-purpose programming language, procedural programming language, imperative programming language programming language that is especially suited to numerical analysis and scientific computing....
    , the first letter in a variable's name indicates whether by default it is created as an integer
    Integer

    The integers are natural numbers including 0 and their negative and non-negative numberss . They are numbers that can be written without a fractional or decimal component, and fall within the set ....
     or floating point
    Floating point

    In computing, floating point describes a system for numerical representation in which a String of digits represents a rational number.The term floating point refers to the fact that the radix point can "float": that is, it can be placed anywhere relative to the Significant figures of the number....
     variable.


See also

  • Naming conventions (programming)
    Naming conventions (programming)

    In computer programming, a naming convention is a set of rules for choosing the character sequence to be used for identifiers which denote variables, types and functions etc....
  • Name binding
    Name binding

    In programming languages, name binding is the association of Value s with identifiers. An identifier bound to a value is said to Reference that value....
  • Overloading
    Method overloading

    Method overloading is a feature found in various programming languages such as Ada , C Sharp , C++, D and Java that allows the creation of several subprograms with the same name which differ from each other in terms of the type of the input and the type of the output of the function....
  • Unique identifier
    Unique identifier

    With reference to a given set of objects, a unique identifier is any identifier which is guaranteed to be unique among all identifiers used for those objects and for a specific purpose....