On Tue, Dec 14, 2004 at 11:10:51PM +0100, H.Merijn Brand wrote:
> > If programmers outside your project look at it and go "Huh?" you've just
> > lost yourself a potential patch as they recoil.
> 
> Don't think so. spaces and bracing is hard to do it so bad as to other people
> unable to be able to read it. It is merely easy to the eye if there is logic,
> and maybe more important consistency in indents

Keeping it within the set of sane bracing styles, ones that perform
the basic functions of indentation and blocking and are not obviously
broken (and yes, I'm including yours in this set :), and not drifting off
into straw-men... 

Style is a matter of allowing rapid communcation without having to puzzle 
out the internal logic.  Done right, good style allows one to "skim" code 
without having to study it.  Any style can be learned, but want to have to
do as little learning as possible to read somebody's code.  Most everyone 
expects the closing brace to be at the indentation level on which the 
conditional started.  Not at the level at which the code inside the block 
is written.  

There's really no quantifiable advantage to either way, its a matter of
expectations.  In such cases go with the one that violates the least
number of potential worker's expectations and eliminates Yet Another thing
they have to learn to work on your code.


To put it in different terms I turn to industrial design.  Donald Norman in 
"Turn Signals Are The Facial Expressions Of Automobiles" has a chapter
entitled "How Long Is Noon?" in which he talks about our time formatting.
In it he talks about AM, PM and now 12 noon and 12 midnight should be 
distinguished.

One argument is this:  AM is an abbreviation of Ante Meridiem, latin for 
"before the middle of the day".  PM is Post Meridiem, "after midday".  As
they are abbreviations they are correctly written "A.M." and "P.M.".
Noon is the meridiem therefore noon should be labeled "12 M".

This is perfectly sensible logic... if you know latin, speak a romance
language or know the history of modern terms.  For your average English
speaker who does not have any of this background it makes no sense 
whatsoever.  Perfectly logic systems can make absolutely no sense if
the reader does not have your frame of reference.  Often the case.

As programmers we love logically consistent systems and think that because
something is logical it is usable.  This ignores the frame of reference
for the reader.  If they do not have your background and know your logic
your perfectly sensible system can become inscritable.

This is why AM is "AM", PM is "PM", and "12 M" is 12 midmnight.  To most 
people AM and PM are just archaic symbols for "before noon" and "after noon" 
and it doesn't matter one wit that they happen to be abbreviations of latin 
phrases.  We may lament the historical loss but that doesn't matter.  What 
matters is clarity of communications.  When there's no obvious improvement
between one format or the other, go with the one that follows understoood 
conventions.

That last bit is important.  When there *is* a noticable improvement then
consider going with it.  In this example it would be 24 hour time.

[1]  Which I'm sure will now spark a nice, pointless debate between the 
Europeans and Americans.  Donald Norman lays out the arguments for 24 hour
time nicely.  The book can be had for $4 used.


-- 
Michael G Schwern        [EMAIL PROTECTED]  http://www.pobox.com/~schwern/
AY!  The ground beef, she is burning my groin!
        http://sluggy.com/d/990105.html

Reply via email to