5. Data Structures

Level: beginner · Reading time: 3 min · Prerequisite: book/poche/04-procedures.html · Last review: 2026-05-09

TL;DR (5 lines)

  • Read the core idea first.
  • Understand one concept at a time.
  • Run small examples.
  • Fix errors early.
  • Move to next chapter only when clear.

Frequent mistakes

  • Skipping prerequisites.
  • Reading without trying examples.
  • Fixing too many errors at once.

Prerequisites: book/poche/04-procedures.html. See also: book/chapters/08-structures.html.

Goal

Group related data into a structure.

Example

form User {
  id: int
  name: string
}

Why it matters

Structures avoid scattered and confusing settings.

Quick check

What happens if you add email: string?

Try this

  1. Create User.
  2. Add a field.
  3. Adapt the user code.

If you're stuck

Start with 2 or 3 fields maximum, then evolve little by little.

Mini quiz

  1. What is the main goal of this chapter?
  2. Which concept is most important?
  3. What will you try right now?

See also

Next best action

Apply one idea from this chapter in a tiny example, then continue.