TRINARY CODING STYLE GUIDE - COMMENTARY

APPEARANCE

Any comments placed OUTSIDE a function should be enclosed in a starred box, 80 characters wide. No blank lines sould be inserted on te top or bottom. Blank lines should only be used to seperate paragraphs. Every line inside the box start with a single space. Indentation should only be used for lists and should use indents of 4. Resulting in indentations of 5, 9, 13, ... Non related commentary should be placed in different boxes. An example

/******************************************************************************/
/* Symetric Multi-Processing support for the IA-32 Architecture               */
/* Copyright (c) 2003, Rudy Koot (Trinary Technologies)                       */
/*                                                                            */
/* This program is free software; you can redistribute it and/or modify       */
/* it under the terms of the GNU General Public License as published by       */
/* the Free Software Foundation; either version 2 of the License, or          */
/* (at your option) any later version.                                        */
/******************************************************************************/
		

As you can see none of the text is centered. Centered lines should be not be used. The only exception is when you have to use ACSII art inside your comments.

CONTENTS

USAGE

I know that that you must have heard this thounsands of times, but it is so important: COMMENT A LOT! I have to repeat this, because every programmer knows this rule, but no one does it. Just look at Linux' source. They are just too under commented. A good measure ment it the code to comment ratio. It is good to have at least as much comments as code. I usualy have even more comments that code, so it shouln't be too hard. Also start commenting before you code and while you code. Don't do it afterwards, because you wont. It is also a good idea to write things you want to down inside your comments so you don't worget it, or somebody else can do it. But if you do that make sure you say that you are going to implement it to avoid anyone, including yourself, thinking it is already implemented.