Coding Style

Godmar Back gback at cs.utah.edu
Mon Feb 22 08:16:15 PST 1999


 Robert,

I'm about to create a short FAQ for Kaffe developers which we'll put
up on www.kaffe.org.  It's not quite done yet, but here's a sneak preview
of the coding style/standard section:

   Does Kaffe have a coding standard?

     * The short answer is no.  In fact, the Kaffe sources are rather,
       shall we say, diverse.

       However, we do ask that you do not reformat existing files when
       making changes.  If a file is formatted in a mostly uniform style, 
       you should keep your changes in that style.  Otherwise, there are 
       no guidelines about how to do indentation, braces, how to name  
       identifiers etc.  Most Kaffe developers adopt a traditional BSDish
       style with one tab/8 character indentation, followed by the brace
       on the same line.  We do ask that you avoid C++ style comments or
       other GNU extensions to C where possible.

I really think this is the best course of action; let other projects
waste time on recurring discussions about coding styles and standards.

    - Godmar

> 
> hi all submitting patches,
> 
> whay do you think, would it be nice to have a sort of Coding Style for Kaffe?
> 
> I often cannot resist adjusting the look'n'feel ;) of the code when I'm
> trying to understand it during the bugfix-creation-mental-phase:
> 
> this adjustment for the 95% consists of white-space and redundant parentheses
> insertion/deletion, e.g.: which is better:
> 
> void method(int i)		void method ( int i) {
> {
> }				}
> 
> if (a+1)			if (a + 1)			if ( a + 1 )
> 
> ((int) value) + 1		((int)value) + 1
> 
> return value;			return (value);
> 
> return method(x);		return (method(x));
> 
> 
> the remaining 5% inludes e.g.:
> 
> -final native static public synchronized String intern0(String str);
> +public static final synchronized native String intern0(String str);
> 
> 
> the problem is: what feels pretty for me might not feel the same for you..
> 



More information about the kaffe mailing list