Subject: Re: conciseness is power
From: rpw3@rpw3.org (Rob Warnock)
Date: Sat, 24 Dec 2005 23:00:09 -0600
Newsgroups: comp.lang.lisp
Message-ID: <JI6dnXZnmaTEujPenZ2dnUVZ_s-dnZ2d@speakeasy.net>
Pascal Bourguignon  <spam@mouse-potato.com> wrote:
+---------------
| Marcin 'Qrczak' Kowalczyk <qrczak@knm.org.pl> writes:
| > There is a difference whether a given idea is abstracted out,
| > implemented once and the abstraction is called multiple times,
| > or whether it's copied & pasted in each place it is used.
| >
| > Looking at compressed size penalizes building abstractions,
| > by measuring the overhead of creating an abstraction but not
| > measuring the amount of copy & paste.
| > 
| > I agree that the length of identifiers is less important than
| > code structure. I think that token count is quite close to the
| > subjective measure of code size for a human.
...
| I'm not saying that the gziped size is an absolute scale of code
| complexity. I'm saying that it's a better measure of code complexity
| than LoC.
+---------------

I somewhat agree. While gzip'd size isn't perfect, it's certainly a
*lot* closer to the Kolmogorov/Chaitin notion of complexity than LOC.

On the other hand, I also somewhat agree with Kowalczyk, in that
informational complexity per se is a lot less important for *humans*
than code structure, and in particular, the length of each separately-
comprehensible "chunk" [in the sense of Miller's "Magical Number Seven"]
of code. Given the *extremely* small size of humans' "primary caches"
[so to speak], keeping the *number* of identifiers per chunk small
is definitely more important than the length of identifiers per se.
But overly-long identifiers whose names themselves don't encode
significant semantic information can be just as bad as too many
identifiers. Consider what happens to the readability of code
which is obfuscated by mapping all programmer-defined identifiers
into a dense set of random names such as "Dj5rBKbtKzIijNeg" or
"c2sRd5ACxmOTVrh4". Or worse, have you ever seen the output of
the classic C obfuscator which uses *only* identifiers starting
with #\I, #\i, #\O, #\o, and whose remaining characters are in
the set "IiOo10"? Not fun.


-Rob

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607



-Rob

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607