Why make a language case sensitive?

Olivier Dagenais olivierS.dagenaisP at canadaA.comM
Sat Jul 15 00:45:47 EDT 2000


As a VB freak (or ex-thereof), I need to point out that the VB IDE will
attempt to make all variables and keywords use the same case.  So, for
example, "if" is always 'converted' as "If" and if you declare a variable as
such:

Dim m_Spam As Long

(which, BTW, the IDE would have 'fixed' the words 'Dim', 'As' and 'Long')

and then you need to refer to m_Spam, you can type it without any capitals,
and when you move the cursor to another line, the IDE will look up the
declaration and match the case of the new instance of the variable with that
of the declaration... For example, I type:

m_spam = M_SPAM + 42  <ENTER>

and it becomes:

m_Spam = m_Spam + 42

...which keeps the readability.  (doesn't it?)  Also, now that I have this
line of code, if I go back to the declaration and change 'm_Spam' to
'm_SpAm', all the references 'm_Spam' will now read 'm_SpAm'...

So, I can't say that I agree with you when you say that forcing the user to
type the name correctly will improve readability, especially in the case of
Pyton when a mis-typed variable name results in a new binding being created,
and not a compile-time error, like in C.  I once read an "article" (more
like a joke) on how to write really bad (obfuscated) C code, and one of the
"tips" was to mix the cases of the letters making up variable names....

If you have a pre-processor or a powerful IDE (more like a compiler built
into an IDE), you can achieve readability that is customized to the person
reading and making a change in the "readability" of a name does not require
doing a [case-sensitive] find/replace.

Let the user have only to remember the sequence of characters and let the
computer find out (in a previous declaration or usage) how they should be
capitalized.

I love Python.  I hope case sensitivity doesn't stay around for too long.
All it *really* allows you to have is something like a previous post, where
a file requires a close method with a small C and for a DB connection, a
close method with a capital C:

aFile.close()
aConnection.Close()

...which just seems pretty silly to me, especially if you're someone trying
to use code from two different sources, and they have adopt similar
conventions, except the case is different.  People just don't think like
computers:  'a' and 'A' are the same letter, and you bring up a good example
in your last paragaph...

--
----------------------------------------------------------------------
Olivier A. Dagenais - Carleton University - Computer Science III


"Anders Eggers-Krag" <aek at aek.dk> wrote in message
news:jbPb5.1245$bb.28195 at news101.telia.com...
> I would say that it improves syntax consequense, leading to more readable
> code
> for others, you are never in doubt about what to look for when looking for
a
> keyword,
>
> in VB you might look for IF, If or if, and they look very different, and
it
> becomes a lot harder
> to read somebody elses code.
>
> the case insensitivity is nice when I am the only one to read my code as I
> could then choose my
> own obscure notation such as mYmetOd() and keep it consequent writing dEf,
> claSs, If eTc.
> wheras case sensitivity makes it more natural to keep a more sensitive
> manner such as myMethod()
> MyMethod() or my_method() throughout that everyone can agree on, I believe
> that case sensitivity
> leads to more uniform code, that again makes it easier to read your
> collegues code. And i think it should
> seem natural to everyone, after all books are written in case sensitive...
> you can't write: "i Am the wisEst
> One of aLl." and be taken seriously
>
> But it depends on which kind of access is needed to the system ie it would
> be dreadfull if DNS
> or SMTP servers were case sensitive and  user enters MicroSoft.com and
gets
> nowhere because
> he should have written microsoft.com.
>
>
> --
> Anders Eggers - Krag
>
>
> "Peter Timaratz" <timaratz at lisco.com> wrote in message
> news:000801bfeda1$fcd99a20$6cb745c6 at timaratz...
> > I can't think of any advantages to a case sensitive language. Python is
a
> > very well-designed language though, so I imagine there is a good reason
> that
> > it is case sensitive. So what are the advantages of a case sensitive
> > language?
> >
> >
>
>





More information about the Python-list mailing list