Case sensitivity

David Mertz mertz at gnosis.cx
Fri Feb 21 22:08:55 EST 2003


"Tim Churches" <tchur at optushome.com.au> wrote:
|challenge anyone arguing in favour of case-insensitivity for Python to
|produce a succinct explanation for beginners of why names and keywords
|are case-insensitive and why literals are not.

Well...  I am certainly NOT in favor of case-insensitivity FOR Python.
That bird has left the coop.  But maybe for some hypothetical future
language.  Or for that matter, documenters of the (many)
case-insensitive languages I have used have had no great difficulty
producing a succinct explanation (for beginners) of why names and quoted
literals are different.

My own shot at describing such a language, for example:

    String literals in FOO are used to describe a precise sequence of
    (case-sensitive) characters.  If you wish to compare strings in a
    case-insensitive style, the idiom "if upper(this)==upper(that):"
    is useful (it "normalizes" case before a comparison is performed).

    Names, keywords, numbers, and other "semantic" aspects of the
    language FOO can vary in their precise spelling.  For example, "bar"
    and "BAR" name the same variable; and "3.0", "3.00", "3e1" and
    "0x03" all name the same number.  While consistency in
    representation aids legibility of programs, allowing minor
    variations makes remembering terms easier for most programmers.

Shall I start a comp.lang.foo newsgroup?

Yours, David...

--
Keeping medicines from the bloodstreams of the sick; food from the bellies
of the hungry; books from the hands of the uneducated; technology from the
underdeveloped; and putting advocates of freedom in prisons.  Intellectual
property is to the 21st century what the slave trade was to the 16th.





More information about the Python-list mailing list