# 2.4 Identifiers

> An identifier is the name you choose for a variable, a subroutine or a type: it starts with a letter or an underscore and distinguishes upper case, lower case and accents.

Web page: https://pseudolearn.app/en/spec/lexico/identificadores

> **In one sentence**
>
> An identifier is the name you choose for a variable, a subroutine or a type: it starts with a letter or an underscore and distinguishes upper case, lower case and accents.

## 2.4.1 How it works

An **identifier** starts with a letter (including ñ, accented vowels and ü) or an underscore. After that it may continue with letters, digits or underscores. A single-letter name is valid.

**Figure 2.4-1: Identifier alphabet**

Two boxes joined by an arrow: the first character, which may be a letter, ñ, an accented vowel or an underscore, and the following ones, which also accept digits and may repeat. Below, four valid names in green and three invalid ones in red.

What may go at the start of a name and what may follow. Digits may follow, never start.

Names are compared **exactly**: `edad` and `Edad` are two different variables, just like `ano` and `año`. Reserved words, on the other hand, ignore case: writing them in lower or upper case makes no difference.

### Program: Names that look alike

```pseudolearn
Algorithm Nombres
  Define edad As Integer <- 1;
  Define Edad As Integer <- 2;
  Define año As Integer <- 2026;
  Define _total1 As Integer <- edad + Edad;
  Write edad, " ", Edad, " ", año, " ", _total1;
EndAlgorithm
```

**Output**

```text
1 2 2026 3
```

*The program finishes normally.*

> **Limit**
>
> Initial alphabet: ASCII letters, ñ, Ñ, accented vowels, ü, Ü and underscore. Following alphabet: the initial one plus the digits 0 to 9. There is no maximum length. A name may not match a reserved word of the profile.

> **Note**
>
> That `edad` and `Edad` are different variables surprises many people, especially because reserved words do ignore case. To check it, find the mistake in a program that defines `Total` and then writes `total`.

**In short**
- Starts with a letter or underscore; continues with letters, digits or underscores.
- ñ, accents and ü are allowed.
- Names distinguish case and accents; reserved words ignore case.

**See also**
- [2.5 Reserved words](https://pseudolearn.app/en/spec/lexico/palabras-reservadas.md)
- [7.6 Scopes and names](https://pseudolearn.app/en/spec/subprogramas/ambito.md)
