Skip to content
BENIBIX Learn

Syntax Highlighting

Development🛠️ Editors & ToolsEditors

Also known as Code Highlighting

Each part of the code gets its own colour, so it is easy to read.

Think of it like

Think of it like colouring a map. Roads are red, rivers are blue, and you see the shape at a glance.

Example

Jack forgets to close a quote. Every line after it turns green like a string, and he spots the slip in a second.

Why it matters

Colours let your eyes find the parts of a line without reading every word. Many small slips show up as odd colours.

Definition

Syntax highlighting shows each part of the code in its own colour. Keywords might be purple, strings green and comments grey. The colours do not change what the code does; they only help you read it. A missing quote often shows up at once, because the rest of the line turns the wrong colour. Almost every code editor does this.

Common mistake

Thinking the colours are saved in the file. The file is plain text; the editor paints it each time.

Key takeaways

  1. 1
    Colour by part. Keywords, strings and comments each get one.
  2. 2
    Only for reading. Colours never change what the code does.
  3. 3
    Shows slips. A wrong colour points at a typo.

Learn it properly