Why are many languages case sensitive?

后端 未结 30 1945
执念已碎
执念已碎 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 04:47

    Every example I've seen supporting case sensitivity is based on a desire to write bad, undescriptive code. e.g. the "date" vs. "myDate" argument - these are both equally undescriptive and bad practice. Good practice is to name it what it actually is: birthDate, hireDate, invoiceDate, whatever. And who in their right mind would want to write code like:

    Public Class Person
        Public Shared ReadOnly PERSON As Person
    End Class
    Public Class Employee
        Public person As Person = person.PERSON
    End Class
    

    Amazingly this is perfectly valid case insensitive VB.Net code. The thought that case sensitivity allows you to even more flagrantly disobey good programming practice is an argument against it, not for it.

提交回复
热议问题