coolharsh55 / kwest

Automatically exported from code.google.com/p/kwest
0 stars 0 forks source link

Coding conventions #7

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What coding convention to follow???

I propose the following coding convention.
While I initially tried to follow the GNU coding standards, I found them, for a 
lack of better word - absurd. 
I feel there are much better and easier coding standards out there.
Picking from them, and understanding the fact that we all are used to a certain 
coding standard from our college years, I've made this sample hello world file 
to show the coding conventions...

Please make sure that you code your functions into a `header.h` and a `code.c` 
so that anyone can simply include the header file as required.

Also reading the header file should provide ample documentation about the 
functions it contains, what parameters it requires and what return values 
should  be expected.

Original issue reported on code.google.com by coolharsh55 on 12 Dec 2012 at 2:34

Attachments:

GoogleCodeExporter commented 9 years ago
1. I'm changing all my files to this convention
2. it is not necessary that every if should be accompanied by matching else
3. string formatting is weird because it was copy-pasted from the web

Original comment by coolharsh55 on 12 Dec 2012 at 2:37

GoogleCodeExporter commented 9 years ago
http://www.kernel.org/doc/Documentation/CodingStyle
This has been influential a lot, please do look it up

Original comment by coolharsh55 on 12 Dec 2012 at 2:41

Attachments:

GoogleCodeExporter commented 9 years ago
as suggested by Phansalkar sir and it matches what I'm trying to suggest - 
basically I'm proposing we follow the "linux kernel conventions"

Original comment by coolharsh55 on 12 Dec 2012 at 7:17