Why does a programming language need keywords?

前端 未结 13 727
野性不改
野性不改 2021-02-01 03:25

For example (in C):

int break = 1;
int for = 2;

Why will the compiler have any problems at all in deducing that break and fo

13条回答
  •  执念已碎
    2021-02-01 03:44

    As others said, this makes compiler parsing your source code easier. But I would like to say a bit more: it can also make your source code more readable; consider this example:

    if (if > 0) then then = 10 end if

    The second "if" and the second "then" are variables, while others are not. I think this kind of code is not readable. :)

提交回复
热议问题