case-sensitivity

Peter Hansen peter at engcorp.com
Wed Nov 12 12:53:18 EST 2003


Douglas Alan wrote:
> 
> I agree with Alex.  Case sensitivity is evil!  When color monitors
> started becoming common, I began to worry that programming languages
> would come to allow you to have blue variable names, and red and green
> variables names, and they would all be different.  Or maybe even
> variable names in mixed color!  Then in mixed color and font.  I
> better be quiet now, lest I give anyone ideas.

Not a bad idea... although the implementation would probably require
something like using a special suffix to represent the colour, so the
file could still be saved as ASCII.  The editor would of course have
to be smart enough to translate this suffix into the appropriate colour,
and then suppress the suffix.  I'm sure vi and that other editor,
whatever it's called, could do that.

Of course, we could also specify the colour separately with new
keywords.  We could have different keywords for different things, 
such as integers, floats, strings, etc.  That way you could reuse
the same variable name for different types of data, without worrying
about conflict.  You could see at a glance which was which!

You could also allow custom defined types... let's call them 
"type defs" for short.  Then you could customize the colouring
for just about any type of variables.

With a large enough palette, you could just reuse the same variable
name for everything, needing only to respect the proper colour for
correct behaviour.  Imagine never having to think up variable names
more complicated than "foo".

def foo(foo, foo):
    foo = foo + foo.foo()
    return [foo for foo in foo(foo.foo) if foo != foo]

(I can't show the proper colourization of the above in the primitive
Usenet medium, so you'll just have to trust me that it works...)

Yes, definitely not a bad idea...  ;-)

-Peter




More information about the Python-list mailing list