Case sensitive and ludicrous statements

Douglas Alan nessus at mit.edu
Wed Dec 10 17:01:52 EST 2003


"rzed" <Dick.Zantow at lexisnexis.com> writes:

> Douglas Alan wrote:

>> "rzed" <Dick.Zantow at lexisnexis.com> writes:

>>> The reason people chose to mix their cases is that one-case code is
>>> difficult to read.

>> no it isn't.  it isn't even difficult to read one-case english.

> so you say, and you illustrate by showing one line.  but if instead
> you have a block of a lot of text, or if you have code that is
> placed in close proximity for line after line you may have reason to
> think otherwise.

no, i really don't.  all-lowercase text is perfectly easy to read.  i
will grant that traditionally-cased english is a bit *easier* to read,
but that doesn't mean that all-lower-case english is *hard* to read.
i converse in email all the time with people who have apparently
removed the shift key from their computer, and i've never had much
reason to complain about it.  unless they have it wired ON all the
time, in which case, i get very IRATE.

> i know i did in the monocase pl/i world and i was
> not alone in that; everyone else in the shop complained about it
> from time to time. it is never an issue that a single identifier is
> easier or more difficult to read in a single case; it is an issue
> when the context is broader.

when the context is broader, you learn to use things like

#-----------------------------------------------------------------------------
# function FOO
#-----------------------------------------------------------------------------

and what-not to provide visual structure to your code.  Which you should
do even when using camelCase.

> a secondary issue is that underscores require the use of the shift
> key on a standard typewriter so they are no easier to enter than
> upper case letters

all the more reason that languages should use dashes, rather than
underscores, for this purpose.  but my reasoning never had anything to
do with easy of typing -- only with ease of reading.  camlCase is just
hard to read, and is a maintenance quagmire in a case-insensitive
language.

> and they add no information that the interspersed capitals do not.

in a case-insensitive language, the dashes most certainly DO add
information, since there is no chance of confounding

   myVar

and

   mYvar

if you write

   my_var

and

   m_yvar

instead.


> whether they make text easier to read than camelcase stuff is a
> matter of opinion and is based on what people are used to.

i_really_don't_think_it_is_a_matter_of_opinion.  i_think_it_is_a
matter_of_human_cognition, and_i'm_willing_to_bet_that_cognitive
psychology_experiments_would_prove_me_right, although_i_have_no_such
experiments_to_cite_at_the_moment.

IHaveBeenUsingCamelCaseEveryDayForAboutTenYearsNow,
andIStillFindItMuchMoreDifficultToReadThanTheAlternatives.
ItNoLongerMakesMeWantToHurlTheWayThatItUsedTo,ButEasyToReadItIsNot.

just compare the preceding two paragraphs for readability.  that
should be all the proof one needs.

> i went from one form to the other and had no trouble adjusting; it
> took very little time for me to come to prefer camelcase.

a chaque son gout, but if you are using camelCase in a
case-insensitive language, i believe that you are still making a
serious mistake.

> judging by its prevalence in a big chunk of the coding world, others
> have managed to make the same adjustment, and i would guess at least
> many of them have the same preference.

there's no accounting for taste, but i still think that they are
making an ergonomic mistake.  people often prefer things for strange
reasons that have nothing to do with real ergonomics, but that doesn't
mean that they wouldn't be more efficient and produce code with fewer
bugs if they didn't use camelCase, especially in a case-insensitive
language.  (just read some of tufte's books or "The Design of Everyday
Things" to see many examples in other domains of misguided but popular
designs that are counter to good ergonomics.)  personally, i would
would look for work elsewhere if i were told that i had to use
camelCase in a case-insensitive language.

|>oug




More information about the Python-list mailing list