Re: Coding Style



On Sun, Jan 18, 2015 at 9:02 AM, Ahmed <ahmed baizid org> wrote:
Hello,

Hi,

For C, I suggest adopting an indent profile like:

  --braces-on-if-line
  --ignore-newlines
  --line-length 1024
  --no-space-after-function-call-names
  --no-tabs
  --swallow-optional-blank-lines

This style is for humans and for machines.
It is readable and I can also do massive modifications with simple Perl
one-liners or m4 scripts, confidently.

Several of your choices (line length, no space after function call
names…) are against what's commonly used in the GNOME world.

The style we want to follow in new code is the one used by default in
GNOME Builder. It is the GTK+ style. You can find the configuration
file for that at
https://git.gnome.org/browse/gnome-builder/tree/src/resources/language/defaults.ini
See also https://help.gnome.org/users/programming-guidelines/stable/c-coding-style.html.en
which may be a bit outdated but should be mostly ok.

Existing code may not always follow this style, as it happens with old
projects. The rule here is to leave it as is and only fix lines that
you're changing in your patches. Otherwise you'd get
style-fixing-noise in the middle of a patch.

For XML, I suggest the formating of `xmllint --format --encode UTF-8`.

Seems good.

We also use Python and of course the style we want to use there is PEP-8.

-- 
Alexandre Franke
Planner maintainer


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]