# Syntax

> The rules for how code must be typed. One wrong sign and it will not run.

**Field:** Software Development  
**Category:** Programming Concepts

## Think of it like

Think of it like the rules for writing a date. Day, month and year must go in the right spots.

## Definition

Syntax is the set of spelling and grammar rules for a programming language. It says which words are allowed and where the brackets, quotes and commas go. Each language has its own syntax. The computer is strict about it, much stricter than a teacher. One missing bracket can stop the whole program from running.

## Example

Jack types print("Hi" and forgets the last bracket. Python stops before running a single line.

## Example code

```python
>>> print("Hi"
  File "<stdin>", line 1
    print("Hi"
         ^
SyntaxError: '(' was never closed
```

One bracket is missing, so Python will not run the line at all.

## Why it matters

Code that breaks the syntax rules never runs. Learning them is the first step in any new language.

## Common mistake

Thinking correct syntax means correct code. A program can follow every rule and still do the wrong thing.

## Three principles

- **Strict rules.** One wrong sign can stop the whole program.
- **Per language.** Each language spells things its own way.
- **Form, not meaning.** Good syntax does not mean the logic is right.

## Related terms

- [Syntax Error](https://learn.benibix.com/term/development/syntax-error)
- [Keyword](https://learn.benibix.com/term/development/keyword)
- [Statement](https://learn.benibix.com/term/development/statement)
- [Source Code](https://learn.benibix.com/term/development/source-code)

## Taught in

- [Hello World in Python](https://learn.benibix.com/learn/development-concepts/hello-world-in-python): Programming Basics, 2/18

---

Source: https://learn.benibix.com/term/development/syntax
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
