Chuck Esterbrook wrote:
On Sun, Mar 16, 2008 at 10:34 AM, David Brown <[EMAIL PROTECTED]> wrote:
On Sun, Mar 16, 2008 at 09:23:51AM -0700, Paul G. Allen wrote:
> 8 spaces is too much, it takes too much space on the line. It forces the
> eye to move and look around the page too much. 2 is too few as it does not
> separate the indented structure enough from the surrounding structures. 4
> seems to be optimal as it provides good separation, does not force a lot of
> eye movement, and does not take up too much space on the line.
>
> (Ref.: McConnell, Steve; Code Complete; Microsoft; <http://www.cc2e.com/>)
But, it's just a bunch of arbitrary numbers. Why should I care what Steve
thinks is "too much" or "too little" spacing. Other people obviously have
differing opinions. Change the numbers to different values, and you will
get a different set of people arguing loudly that they are absolutely
right.
Ah, but what is the size of those different sets? A LOT of people use
4. I see it more often that 2 which I see more often than 8.
If you restrict your observations to "Linux kernel developers" then,
of course, 8 rules. But across a large range of code on Linux,
Windows, Java, Python, etc. 4 appears to dominate. Why?
I think it dominates because it has a balance to it. Not too much. Not
too little. If some degree of balance isn't desirable then we'd see 1
and 10 more often.
I'm finding that I'm starting to rely on color more.
Indentation is there simply because we had no other good visual
identifier. I'm not advocating removing indentation, but I'm finding
that I seem to work faster with *color* instead.
Probably because my eyes don't have to keep going to the left edge for a
cue. With color, the cue is right where I'm looking.
I started this by colorizing my parentheses in Scheme. I like it. A
lot. It took me almost no time to find going back the other direction
to be painful. That's generally the sign of a good change.
Now, I need to look at the elisp code and change that to adding the
color to the *background* rather than the *foreground*. The background
is a much bigger target--after a while I probably won't even see the
glyph, I'll just see the color.
Eventually, I'll probably try to extend the color to the entire
syntactic entity rather than just the begin-end marks.
Unfortunately, I'll probably start to curse if I actually like it.
Doing syntactic analysis is painful in most languages, and full
colorization really requires that.
-a
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg