Programming Foundations
Conditional
Code that runs different instructions depending on whether something is true or false.
Reviewed by the RadarTrek editorial team · June 2026
A conditional (an if/else statement) lets a program make decisions: run this block of code if a condition is true, otherwise run that one. Every piece of branching logic in software — show this if logged in, charge this if the cart isn't empty — comes down to a conditional underneath.
Why it matters
- —Conditionals are how software responds differently to different situations instead of always doing the same thing.
- —Almost every bug involving "wrong thing happened" traces back to a conditional that didn't match reality.
- —Reading nested conditionals carefully is a core debugging skill in any language.
Where to learn this
🎓
Conditionals
Think Like a Programmer course
This is the exact lesson that covers this term in depth — with examples, diagrams, and a hands-on exercise.