Why are many languages case sensitive?

后端 未结 30 1988
执念已碎
执念已碎 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条回答
  •  隐瞒了意图╮
    2020-11-29 05:11

    Case sensitivity adds to language readability by the use of naming conventions. You can't write

    Person person = new Person("Bill");
    

    if your language is case insensitive, because the compiler wouldn't be able to distinguish between the Class name and the variable name.

    Also, having Person, person, PersoN, PeRsOn, and PERSON, all be equivalent tokens would give me a headache. :)

提交回复
热议问题