🧭Synchronous Code
Also known as Synchronous, Sync Code, Blocking Code
Code that runs one line at a time. Each line waits for the last to finish.
Think of it like
Think of it like a queue at one till. Each person waits until the one in front is done.
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.
Definition
Common mistake
Key takeaways
- 1One at a time. In the order written.
- 2Waits block. Nothing else runs.
- 3Easy to read. Top to bottom.