Compare these two examples:
//--------Example 1 if if loop if endif // this endloop endif else endif //--------Example 2 if { if { loop { if { } // this } } } else { }Suppose the line marked "this" was accidentally omitted. Under the Endx scheme, the compiler (or a human) would know something was wrong as soon as it reached Endloop because Endloop does not match the open If statement. (If and Endloop are obviously not meant to be paired.)
With braces, the compiler will not know until it reaches the very bottom because ANY right brace ("}") can match the unfinished If statement. The compiler has no way to distinguish between an If block ender and a Loop block ender. One right brace looks just like any other right brace.
Also notice how the else statement is more complicated with braces. It has 3 components instead of the one needed by the Endx method.
When I used C, the compiler nearly always pointed out the nesting problem as being at the end of the routine, never in the middle. The Endx approach can usually find it closer to where the problem actually occurred if there is a variety of block types in the routine, which there usually is: IF, CASE, LOOP, etc. (Some brace languages can tell if an ELSE is dangling by itself, which is of some limited help.)
Thus, the "Endx" approach provides more matching information to the compiler than curly braces (or Pascal's BEGIN...END's). It is better documentation for both the human reader and the compiler.
Also, in Endx languages, a block is usually automatically implied by the very existence of the blocking statement ("if", "while", etc.). The brace languages, on the other hand, usually need the starting brace the have a full statement. Obviously, a missing brace is more likely to occur and harder to spot than a missing block statement. Endx greatly reduces time spent on "nest hunts" in the case that a block specifier is accidentally omitted.
Unfortunately, languages like Visual Basic have cluttered up the reputation of X/EndX type languages by providing too many variations on identical structures and unnecessary "noise words" like "Do" and "Then".