Why make a language case sensitive?

olivierS.dagenaisP at canadaA.comM.bbs olivierS.dagenaisP at canadaA.comM.bbs
Sun Jul 16 12:00:02 EDT 2000


VB's IDE is more than just a text editor.  Every line is checked for syntax
errors and I think compiled in the background.  Of course no other editor
could be as good, unless they also had access to the VB compiler/debugger.

Using VC's autocompletion/intellisense, you can get similar results to VB,
so something like this can be done for any language, that is correct, but
not to the extent where the editor is also a compiler.  It may not be all
that hard to implement self-correction and syntax checking in Python, since
we have "exec", but you are right:  without variable declarations this can
prove to be difficult.  Maybe whoever implements a self-correcting/syntax
checking IDE for Python should enfore a convention for "declaring" the
variables, without affecting the language itself.  Something like this, for
example:  (I'm new to Python, so please excuse the big fat mistakes I might
have made)

def SpamWindow ( ):
    " Will draw the value of m_Spam to the DC associated with the current
window handle "
    # var m_Spam, m_hWnd, m_hDC

    m_hWnd = GetCurrentWindowHandle ( )
    m_hDC = GetDCFromhWnd ( m_hWnd )
    m_Spam = m_Spam + 42
    DrawToDC ( m_hDC, m_Spam )
    DestroyWindow ( m_hWnd )

Where the variables are declared in the form of a comment that starts with
the letters "var" which, I think, is how JavaScript declares variables,
isn't it?  So, by having a line at the beginning of a function (right after
the description line, which I hope I didn't screw up) indicating the names
of the variables we intend to use, any name that isn't in that list and
isn't in anything we imported would be highlighted as a mistake, and if only
the case differs, the editor would make the case match the declaration...

Naming conventions are great, but also impossible to get everybody on earth
to accept (and use) them, unless your language enforces it, primarily
because we tend to think different, the latter being a wonderful thing!  So
your naming convention is probably wonderful, but maybe also different than
that of a third party, whose module you want to use....

Come to think of it, I don't think I have a problem with the language being
case-sensitive.  I have a problem with the editor making me think about a
detail that I have come to not have to worry about by using VB.  VB may or
may not be case sensitive, I wouldn't really know, but what's great is that
I don't have to worry about it.

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


"Anders Eggers-Krag" <aek at aek.dk> wrote in message
news:o8kc5.203$rg.9815 at news101.telia.com...
> I know that the VB IDE does this, but that is exactly because Microsoft
> realised
> that case sensitivity has advantages, and then they enforced case
> sensitivity in a
> way that is, agreed, in many ways smart. The real problem in Python does
not
> occur because of case sensitivity it occurs because you do not need to
> declare
> your variables. Case sensitivity is a good way way to keep the same case
> across
> different development platforms - the VB concept only works because if you
> write
> VB you use Microsofts VB IDE, not Ultra Edit, Emacs, notepad, Borland, you
> name it.
> Mircosofts system enforces IDE monopoly, which is anoying since I do not
> like the Visual
> studio IDE, I strongly prefer Borlands, or even better Ultra Edit.
>
> And the VB IDE concept could easily be implementet in a case sensitive
> language as well.
>
> And one more thing, you do not need to remeber the case of any single
> variable if you keep
> a strict definition of how case should be used: in my case all new words
> start with capital,
> except the first word of a property, method or simple type - that way I am
> never in doubt
> as to 1: what type I am dealing with, 2: never in doubt as to what the
case
> is suposed to be used...
>
> --
> Anders Eggers - Krag
>



More information about the Python-list mailing list