Re: coding style

Tim Mann <[email protected]>
Newsgroups gmane.comp.gnu.xboard.devel
Message-ID <CA+2-M130mbJtsjLzwcr_NgnXh8Fh25VmCc115VRE9O5jY-+qAg@mail.gmail.com>
Odd, I never noticed that space after the function name in the GNU standard
(or other GNU programs) before. Sure enough, though, there it is.

On Mon, Jan 2, 2012 at 5:07 PM, Arun Persaud <[email protected]> wrote:

> Hi
>
> On 12/23/2011 02:42 AM, Byrial Jensen wrote:
> >[...]
> > int MyFunc(char a, char b, int c)
> > {
> >   ...
>
> fine with me... The GNU coding standards [1] use this format:
>
> int
> MyFunc (char a, char b, int c)
>
> the newline is AFAIK, so that you (or automated tools) can search for
> ^MyFunc and they add a space after the function name. I would prefer if
> we follow these standards, if that's ok with everyone.
>
> > [...] Another "new" thing I had like to use, is the const qualifier. It
> can
> > help finding bugs, and it allows for more aggresive optimisation.[...]
>
> sounds good.
>
> How about also using the following in the future for ifs and while loops
>
> if (x < foo (y, z))
>  haha = bar[4] + 5;
> else
>  {
>    while (z)
>      {
>        haha += foo (z, z);
>        z--;
>      }
>    return ++x + bar ();
>  }
>
> Another thing that I would like to add would be a short comment at the
> beginning of a function that explains what the function does (unless the
> function is only a few lines or very simple).
>
> Arun
>
> [1] http://www.gnu.org/prep/standards/standards.html#Formatting
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.