IT lexicon › Programming › Conditional

Conditional

Programming På svenska → Updated: 2026-11-13

Control-flow construct where code picks a path based on true/false evaluation. if, else, switch, match, ternary operator.

Universal across nearly all programming languages. Functional languages have if as an expression (returns a value). Pattern matching (Rust, Scala, Haskell, Swift, modern C# + Python) is more powerful than switch — destructures while matching. Branchless code is an optimization technique to avoid branch mispredictions in hot loops. Short-circuit evaluation: a && b doesn't evaluate b if a is false.

← Back to the lexicon