[FRIAM] Whitespace

Raymond Parks rcparks at sandia.gov
Mon Sep 11 16:24:29 EDT 2006


Robert Holmes wrote:
> So which is "better" coding style, foo[ 0 ] + bar[ 0 ] or foo[0]+bar[0]? 
> Where exactly should your block delimiters go and should they be 
> indented? Here's a chap who suggests bypassing whitespace debates by 
> building the coding style into the language: if you don't follow the 
> style you generate a compiler error. Might seem crazy, but I actually 
> find it quite compelling, particularly for projects where I'm 
> collaborating on common code.

   Right on.  Everything should fit in 80 columns with the line number 
in the first 8 spaces.  All variables should be typed by their first 
letter.  Program flow should be direct, by jumping to a line number, or 
calculated.

   Even better, eliminate the whole need for whitespace and simply write 
the value that needs to be in each bit next to the last bit.  You don't 
need whitespace to toggle code into memory.

:-)

-- 
Ray Parks                   rcparks at sandia.gov
IDART Project Lead          Voice:505-844-4024
IORTA Department            Mobile:505-238-9359
http://www.sandia.gov/scada Fax:505-844-9641
http://www.sandia.gov/idart Pager:800-690-5288




More information about the Friam mailing list