Sync
ELI5 — The Vibe Check
Sync means one thing at a time, in order. You order food, stare at the kitchen wall, and only get to sit down when the food arrives. Simple and predictable, but you're stuck waiting for each thing to finish before moving on.
Real Talk
Synchronous code executes sequentially — each operation blocks until it completes before the next one starts. Simple and easy to reason about, but it can freeze the entire program while waiting for slow operations like file reads or network calls.
Show Me The Code
// Synchronous — blocks until file is read
const fs = require("fs");
const data = fs.readFileSync("file.txt", "utf-8");
console.log(data); // only runs after file is fully read
When You'll Hear This
"That's a sync call — it'll block the event loop." / "Use async operations for I/O — sync only makes sense for startup config loading."
Related Terms
Async
Async means 'don't wait around'. You order food at a restaurant, then chat with friends instead of standing at the kitchen window staring.
Concurrency
Concurrency is juggling multiple tasks at once — not necessarily at the exact same instant, but switching between them fast enough that they all seem to be...
Pure Function
A pure function is the well-behaved kid of programming.
Thread
A thread is a mini-worker inside your program that can run tasks independently.