Why are many languages case sensitive?

后端 未结 30 2048
执念已碎
执念已碎 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:13

    Case sensitivity doesn't really help case consistency.

    Foo.Bar  
    foo.Bar  
    fOO.bAR  
    

    In a case insensitive language that can be fixed automatically by the editor easily. In a case sensitive language fixing it it's harder as it may be legal. The editor first has to ckeck if foo.Bar and fOO.bAR exist and also has to guess that you typed with the wrong case rather than forgetting to declare the variable (as Foo is different to fOO).

提交回复
热议问题