Languages have evolved in one of two streams: those that incorporate the use of an end-marker, or structure terminator, and those that don’t. Those that don’t use an end-marker, classically fall into the trap of syntactic issues such as the dangling-else. Those that do, are often better structured, relying less on the specific use of block statements to enclose groups of statements. Many languages from the ALGOL family (Modula, Modula-2, Oberon, Ada), require end-markers on all structured statements. Modula-2 uses end to terminate all its structures, and both Fortran 90+ and Ada use the end if clause. Algol68 decided on using the initial keyword backwards, for example if ends in fi, case ends in esac.
Let’s consider Ada for example.
if condition then sequence_of_statements else sequence_of_statements end if;
The if and end if structure avoids dangling-else ambiguity. Now writing a nested series of if statements looks like this:
if condition1 then S1 else if condition2 then S2 else if condition3 then S3 else S4 end if; end if; end if;
Of course this code can be made even simpler with the use of an else-if combination clause. In the case of Ada, this is elsif.
if condition1 then S1 elsif condition2 then S2 elsif condition3 then S3 else S4 end if;
More recently, the language Julia incorporates the use of the end keyword to terminate both control structures, and functions.