# Synchronous Code

> Code that runs one line at a time. Each line waits for the last to finish.

**Field:** Software Development  
**Category:** Programming Paradigms  
**Also known as:** Synchronous, Sync Code, Blocking Code

## Think of it like

Think of it like a queue at one till. Each person waits until the one in front is done.

## Definition

Synchronous code runs one line at a time. Each line waits for the one before it to finish. If a line asks for a file or a web page, the whole program stops and waits. This is easy to read, because things happen in the order they are written. It becomes a problem when a wait is long. A screen can freeze, or a server can stop answering other people.

## Example

Jack's script downloads 10 pictures one after another. Each takes 1 second, so the script takes 10 seconds.

## Why it matters

Most code you write runs this way. Knowing where it waits shows you where it gets slow.

## Common mistake

Doing a slow download in synchronous code inside an app's screen. The whole window freezes until it ends.

## Three principles

- **One at a time.** In the order written.
- **Waits block.** Nothing else runs.
- **Easy to read.** Top to bottom.

## Related terms

- [Asynchronous Code](https://learn.benibix.com/term/development/asynchronous-code)
- [Event Loop](https://learn.benibix.com/term/development/event-loop)
- [Statement](https://learn.benibix.com/term/development/statement)
- [Program](https://learn.benibix.com/term/development/program)

## Told apart from

- [Synchronous vs Asynchronous Code](https://learn.benibix.com/compare/synchronous-vs-asynchronous-code): Synchronous code waits for each line to finish before the next one starts. Asynchronous code starts a slow task, moves on, and handles the result when it arrives.

---

Source: https://learn.benibix.com/term/development/synchronous-code
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-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
