What is the correct term, key word or reserved word?

Asked

Viewed 314 times

8

In programming we have certain "special words" that do specific things.

These words are popularly called keywords or reserved words.

What is the correct term for these words?

Examples: if, double, while, this, interface, among others.

1 answer

8


Both are correct because they mean different things to the same thing, i.e., reserved word means that that word cannot be used for identifiers in your code, the language prohibits this because it possibly has use for them. Already the keyword is the one that indicates that does something special in the code. The words are usually the same, but has exceptions.

There may be reserved words that are not effectively used by the language and therefore cannot be considered a keyword (e.g..: goto Java). There are keywords that are contextual, so in certain contexts they are not reserved (e.g..: where or value of the C#).

There are languages that allow all keywords to be used freely, so they do not have reserved words, since Udo in identifier can be done unambiguously.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.