Fun to Program – Coding style

Date: 2013/08/24 (initial publish), 2021/08/02 (last update)

Source: en/

Previous Post Top Next Post


This was originally written and created around 2013 and may require to be updated. (2021)

Coding style

Follow the existing practice for the source.

Osamu’s preference at this moment is as follows:

C coding style

There are 2 major practices for the C coding style.

There are many variants in use.

Here are summary of the K&R styles.

See also[Notes on Programming Practices] by Lawrence Kesteloot for some detail C style examples.

Naming conventions

Basic naming convention used in C is:

For many object oriented languages, CamelCase naming convention is introduced to differentiate between class name and class instance name.

The Hungarian Notation especially Systems Hungarian which encodes the physical data type into prefix is deplored. There are[some defense to Apps Hungarian which encodes the logical data type into prefix].


Reformat source with indent:

$ indent -linux foo.c

Document style


There are four golden rules:

See more at GNOME Documentation Style Guide and GDP Documentation Guidelines .


See Documentation Style Guide .


See A Style Guide for GNU Documentation (PDF) .


European Commission recommends in How to write clearly (PDF) (HTML) as:


See Wikipedia: List of style guides .

Previous Post Top Next Post