Proposal3: Make $_ a valid identifier character

Richard A. O'Keefe ok at atlas.otago.ac.nz
Mon May 29 23:02:36 UTC 2000


I wrote:
	> Using underscore in symbols is really rather nice.
	> Almost *anything* would be better than baStudlyCaps.
	> BaStudlyCapsIdentifiersAreJustSoHorriblyUgly.

Tim Rowledge wrote:
	I guess we just have to agree to differ; with the obvious proviso that
	I'm actually right and you aren't :-)
	
If you want to buy an argument, here goes.

The human race has *had* a couple of thousand years of writing systems
without word separators (although IIRC, cuneiform had a word separator
character).  It turned out to be a bad idea.  The invention of the blank
(a word separator character that isn't _any_ mark) was one of the great
inventions in the history of writing.

It has been a long time since I read the relevant literature, but there
_is_ scientific literature purporting to show that well spaced text is
much easier to read than crusheduptext.

The software engineering literature is in general agreement that multi-word
identifiers with some kind of word separator are easier to read than
crushedupones.  The Ada Quality and Style Guidelines, which were developed
very carefully and revised in the light of experience, strongy recommend
using the low line.

Not the least of the defects in the BaStudlyCaps style is that when you
have to refer to an acronym in one of them it becomes ambiguous.
Even when it's not ambiguous, "DOM_Core" is clearer than "DOMCore".
(For some reason, especially in handwriting, the C tends to be hard
to see in that one.)

I suppose one key difference is whether you intend a multi-word identifier
to be percieved as multiple words (as I do) or as a single `word'.

Let us not lose sight of the fact that Smalltalk (like Pascal) originally
didn't include low lines because it simply _couldn't_; the first version
of ASCII just plain didn't include them.  (Pascal was actually constrained
by another character set.)  When the Pascal standard was revised (giving
ISO Pascal Extended), that technological barrier to good naming no longer
existed, so it was dropped.  When the Smalltalk standard was produced,
that technological barrier to good naming no longer existed, so it was dropped.

Clinging to BaStudlyCaps because "that's the way it has always been done
in Smalltalk" (as another person suggested) would be like insisting that
Fortran stick with 6-letter identifiers forever.  Thank goodness the F90
committee didn't swallow that kind of argument.





More information about the Squeak-dev mailing list