delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/04/06/16:23:28

Message-ID: <20000406151722.12080.qmail@web207.mail.yahoo.com>
Date: Thu, 6 Apr 2000 08:17:22 -0700 (PDT)
From: JCBass Player <jcbassman AT yahoo DOT com>
Subject: Re: Bracketing: A Matter of Style
To: djgpp AT delorie DOT com
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

You are not alone; I code this way too. And if
> someone would care to
> point out the benefits of the predominant bracketing
> style, I would much
> 
> appreciate it 
 ...if you would keep your opinion to yourselves!

    John


--- james archer <snowphoton AT mindspring DOT com> wrote:
> I know this probably puts me in the "weirdo"
> category, but I have always
> 
> coded (and probably always will), with a bracketing
> style like this:
> 
> int main(void)
>     {
>     printf("Hello, World!");
>     return 0;
>     }
> 
> That seems to me to be the most logical way to do
> it, for a variety of
> reasons:
> 
> 1) The function is clearly visible, instead of being
> obscured, because
> it is the only thing on the far left.  This may seem
> trivial, but it
> makes it much easier to skim through code looking
> for a particular
> function.
> 2) All the contents of the function (or loop or
> whatever) line up, so
> that it is easy to tell what is contained in what.
> 3) It is easy to tell which brackets are unpaired
> (for those lazy folks
> who always forget to close them), because the start
> and end brackets
> line up.
> 4) The white space helps separate chunks of code and
> thus make them
> easier to understand at a glance.
> 5) Aesthetically speaking, it produces clearer,
> better-looking code
> (imho).
> 
> I realize that most coders are almost religiously
> against this
> bracketing system, and cling instead to the trendier
> style exemplified
> thusly:
> 
> int main(void) {
>     printf("Hello, World!");
>     return 0;
>     }
> 
> (...or some variation thereof).
> 
> This appears much more awkward, and it accomplishes
> little.  The coders
> are saving a single line of whitespace, while losing
> the aforementioned
> benefits of the "lined-up" bracketing style.
> 
> Perhaps, of course, I am completely wrong.  If
> someone would care to
> point out the benefits of the predominant bracketing
> style, I would much
> 
> appreciate it.
> 
> James


=====
Visit my web page at: http://www.angelfire.com/md/jcbassman

__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019