December 31, 2015
The if–else statement (a.k.a., conditional statement, conditional expression, etc.) is a basic feature of programming languages. In the languages I first learned (BASIC, C, Python), I thought if-else was a monolithic thing. Many languages have an elseif statement, and some languages (e.g., C, Ruby) have a switch or case statement that takes care of complicated if-elseif-elseif-elseif… situations. All of these are just syntactic sugar for a chain of if-else statements, which reinforced my idea that if-else was monolithic.