Case Sensitivity and Learnability

Tres Seaver tseaver at starbase.neosoft.com
Sat Jan 29 10:04:07 EST 2000


In article <86u4uf$26lq$1 at thoth.cts.com>, Will Rose  <cwr at crash.cts.com> wrote:
>Tres Seaver <tseaver at starbase.neosoft.com> wrote:
>: Thinking about the notion of case sensitivity as a barrier to CP4E, as
>: advocated quite glibly at IPC8, I typed up this module on the plane to
>: explore the consequences of allowing/encouraging users to enter case-
>: mangled code, especially in non-interactive uses (I think that distinc-
>: tion may be important, because readability is almost insignificatn in
>: an interactive session).
>
>
>Your arguments are reasonable, but they are arguments against systems
>which are both case-insensitive _and_ case-preserving.  The trouble with
>CI/CP is that the compiler sees a different set of tokens from those seen
>by the programmer, and it's sometimes difficult for the programmer to
>realise this.  If unskilled programmers find case too difficult or
>distracting, the cure is to force a single case, either upper or lower. 
>This could be done by an (optional?) compiler switch.

One project I have done required modifying a large body (60,000+ lines) of
case-sloppy ObjectPascal (a CI/CP language).  I tried a couple of tweaks
to aid readability, and flattening the case was the best of a bad
lot.  In general, I don't believe that "case flattened" code is more
readable than code which uses case "properly", although case-flattening
does reduce certain classes of typing errors.

The fix which I think would best help the novice typing at an interactive
prompt involves incremental compilation, coupled with an heuristic which
"suggests" the properly cased identifier (a la spell checking).

I do think that measuring readability for novices of case-mangled vs.
case-flattened vs. case-enlightened code is feasible;  I also believe that
it would be a great deal simpler than trying to measure "usability" for
those who use the language beyond the initial learning curve.  I would also
like to see data which addresses my hypothesis that learning to read code
is an essential prerequisite to achieving competency in the language.


-- 
---------------------------------------------------------------
Tres Seaver           tseaver at palladion.com       713-523-6582
Palladion Software    http://www.palladion.com



More information about the Python-list mailing list