Why are many languages case sensitive?

后端 未结 30 2049
执念已碎
执念已碎 2020-11-29 04:35

Why are many languages case sensitive?

Is it simply a matter of inheritance? C++ is case-sensitive because C is, Java is case-sensitive because C++ is, etc.? Or is t

30条回答
  •  猫巷女王i
    2020-11-29 05:02

    It's actually extremely practical, both for the developer and for the language syntax specification: lower/upper case distinction adds a great deal of expressiveness to identifier naming.

    From the point of view of the language syntax, you can force certain identifiers to start with a lower or upper case (for instance Java class name). That makes parsing easier, and hence helps keeping the syntax clean.

    From a developer point of view, this allows for a vast number of convenient coding conventions, making your code clearer and easier to understand.

提交回复
热议问题