Contextual Keywords
A language with too many reserved keywords can definitely be annoying to developers because of the need to escape keywords all over the place. Especially because keywords are usually based on the English language, clashes with identifiers are a very real risk. Imagine what would happen if value were a reserved keyword:
int @value = discount.Value;
As a matter of fact, value has a reserved meaning in C#, but only in certain contexts. This combines the best of both worlds, using natural-sounding English words to represent programming language features while leaving the word available for use as an identifier in certain contexts. You can refer to those identifiers with occasional special meaning as contextual keywords, although ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access