Programming Foundations
Loop
Code that repeats an action automatically, instead of writing it out by hand each time.
Reviewed by the RadarTrek editorial team · June 2026
A loop runs the same block of code repeatedly — once per item in a list, or until some condition is met. Loops are what let a program process a thousand database rows, or a million, with the same few lines of code that would handle just one.
Why it matters
- —Loops are how programs scale — the same logic that handles 1 record handles 1 million.
- —Off-by-one errors in loops are one of the most common (and most classic) programming bugs.
- —Understanding loops is a prerequisite for understanding how arrays and lists are processed in any language.
Where to learn this
🎓
Loops
Think Like a Programmer course
This is the exact lesson that covers this term in depth — with examples, diagrams, and a hands-on exercise.