Skip to main content

Questions tagged [keywords]

For questions about keywords, which are tokens with special meanings in a programming language.

Filter by
Sorted by
Tagged with
26 votes
9 answers

Are there good reasons to minimize the number of keywords in a language?

Are there good reasons to attempt to keep the number of keywords/reserved tokens in a language to a minimum? Such as by repurposing existing keywords for new syntax instead of adding new ones. Related:...
CPlus's user avatar
  • 8,321
21 votes
14 answers

Preserving backwards compatibility when adding new keywords

Inspired by Why do keywords have to be reserved words? Suppose that you're the BDFL of a programming language. Version 1 of the language becomes decently popular. A few years later, you decide to ...
dan04's user avatar
  • 1,959
17 votes
7 answers

The static keyword and clarity in language design

Across languages that use the word static as a keyword or reserved word, I have observed it to mean: "This variable, despite being declared locally, shall be ...
Karl Knechtel's user avatar
11 votes
8 answers

What are the pros and cons of allowing keywords to be abbreviated?

A language that I use (M) has this nifty feature that allows you to abbreviate most keywords to a single letter. For instance, the following code: ...
Isaiah's user avatar
  • 789
10 votes
7 answers

Why do keywords have to be reserved words?

In many languages, the authors are hesitant to add more keywords, because doing so would break any existing code that happens to use those keywords as identifiers. However, they could do what C is ...
CPlus's user avatar
  • 8,321
10 votes
3 answers

How do language designers determine what feature flags are part of the standard library and what are part of syntax?

Java has the @Override annotation. This annotation, when applied on a method, basically says that this method is intended to be an override of a superclass method. ...
Seggan's user avatar
  • 2,723
8 votes
5 answers

Are there any reasons not to have built-in constants?

As of C17 there are no built-in constants. To use true false NULL or similar one must ...
CPlus's user avatar
  • 8,321
8 votes
2 answers

How to correctly highlight contextual keywords?

Contextual keywords are tokens that are keywords in some contexts, and identifiers in others. Consider this example, which SE's highlighter gets wrong: ...
Bbrk24's user avatar
  • 9,067
-4 votes
3 answers

Alternative names for a value that can either be true or false? [closed]

I know most languages use 'bool' or 'boolean' but I do not really like that name seeing as it was named after a person and a highly doubt that person invented the idea of yes or no questions ...
user1345541's user avatar