Re: [PATCH] new UDPCP Communication Protocol

Jesper Juhl
2011-01-02T21:40:41Z

On Sun, 2 Jan 2011, Stefani Seibold wrote:

> Am Sonntag, den 02.01.2011, 21:48 +0200 schrieb Daniel Baluta:
> > Hello,
> >
> > I have some style comments, please read below.
> >
> > > +struct udpcp_statistics {
> > > + unsigned int txMsgs; /* Num of transmitted messages */
> > > + unsigned int rxMsgs; /* Num of received messages */
> > > + unsigned int txNodes; /* Num of receiver nodes */
> > > + unsigned int rxNodes; /* Num of transmitter nodes */
> > > + unsigned int txTimeout; /* Num of unsuccessful transmissions */
> > > + unsigned int rxTimeout; /* Num of partial message receptions */
> > > + unsigned int txRetries; /* Num of resends */
> > > + unsigned int rxDiscardedFrags; /* Num of discarded fragments */
> > > + unsigned int crcErrors; /* Num of crc errors detected */
> >
> > Is there any strong reason to have this camel case naming?
[...]
> >
> > same here.
> >
>
> I think there is no nameing convention in linux, as i know it is a
> developer decision.
>

Chapter 4 of Documentation/CodingStyle seems to disagree with you:

" Chapter 4: Naming

C is a Spartan language, and so should your naming be. Unlike Modula-2
and Pascal programmers, C programmers do not use cute names like
ThisVariableIsATemporaryCounter. A C programmer would call that
variable "tmp", which is much easier to write, and not the least more
difficult to understand.

HOWEVER, while mixed-case names are frowned upon, descriptive names for
global variables are a must. To call a global function "foo" is a
shooting offense.
"

This seems (to me at least) to suggest that CammelCase is frawned upon.

--
Jesper Juhl <jj@chaosbits.net> http://www.chaosbits.net/
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please.