Re: [tuxdroid-user] PATCH: For new coding style
Status: Beta
Brought to you by:
ks156
From: David B. <da...@ja...> - 2007-03-12 11:43:37
|
On Sat, 10 Mar 2007 16:23:20 +0100, Srikanta Prasanna <sri...@gm...> wrote: > Hi, > > As we discussed yesterday on IRC, I'm submitting a patch > to change existing daemon trunk code to follow new coding > style. Hi Srikanta, Thanks, greatly appreciated. > Some points to remember: > - Changes almost all the files. > - No functionality changes. > - Lots of changes, so its basically upto the maintainer > to accept/reject. :-) No problem, I applied it loaclly and indeed have to commit it now otherwise it will break soon. > - I've changed the existing code to follow the coding-style as > I've documented on the website how-to > ( > http://www.tuxisalive.com/documentation/how-to/guidelines-for-creating-and-packaging-an-application). Now the indenting and spacings look like they should be :-) In these guidelines, I was surprised to see that you prefer flower braces on a new line (#2). That's the way I personally like it but when looking at various guidelines I saw that most of the time they prefer and recommend the more compact use #1 instead. I'm just concerned many coders will prefer #1. What do you think? #1: if (test) { // do something } #2: if (test) { // do something } Another point, functions seems to be declared that way: type my_function ( type arg1, type arg2, ) { // body } while another common way is type my_function (type arg1, type arg2) { // body } I've seen that the first way was preferred in order to add comments for every argument on each line. But if we use doxygen to generate comments, we don't really need that as the params should be documented in the function comment I think. I'd like to have some opinions quickly so I can commit the patch if everyone seems to agree to the current guidelines or correct it. Thanks david |