Some old languages did not have keywords at all, in particular PL/1 where
IF IF=THEN THEN BEGIN;
/* some more code */
END;
was a legal piece of code, but completely unreadable. (Look also into APL as an example of write-mostly programming language, which is completely cryptic to read a few months later, even by the code's original author).
The C and C++ language family have a set of keywords defined by the language specification. But there are very widely used languages with billions of legacy source code lines. If you (or their standardization committee) add a new keyword, there is a chance of collisions with some existing program, and as you guessed and others answered this is bad. So if the standard added for instance enum_class
as a new keyword, chances are that someone would already have used it as an identifier, and that entity would be unhappy (to have to change their code when adopting a new C++ standard).
Also C++ is widely known to be slowly parsed (in particular, because standard headers like <vector>
are pulling dozen of thousand lines of source code, and because modules are not in C++ yet, and because the syntax is strongly ambiguous), so complexifying the parser to handle new syntax is not a big deal (parsing C++ has always been horrible anyway). For example the GCC community is working much harder on new optimizations than on new C++ features (apparently, recent features of the C++ standard library requires much work than parsing new syntax), even if the jump from C++03 to C++11 was a huge jump and required a lot of work in the C++ frontend. This is less true for the C++11 to C++14 jump.
Some other languages (e.g. some dialects of Lisp such as Common Lisp and some Scheme, where you could redefine a let
or if
macro, and macros in homoiconic languages like these are very different, since operating on ASTs, from the crude textual substitution mechanism in C or C++...) permit the redefinition of existing keywords; read also about hygienic macros. But this can make the source code difficult to understand a few months later.