You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by Ruwan Janapriya <ja...@wso2.com> on 2008/05/04 08:35:22 UTC

Correct Axis2/C coding conventions.

Hi All,

Following is extracted from Axis2/C coding convention document [1].

" 4. Function Parameters and Return Value Conventions

      Each function should be passed a pointer to an instance of the
axutil_env_t struct as the *first *parameter. If the function is tightly
bound to a struct, the *second *parameter is a pointer to an instance of
that struct. "

But almost all the functions implemented in Axis2/C, axutil_env_t is passed
as the *second *parameter if there is a tightly bound struct available(that
struct would be the *first *parameter).

Further to above, AFAIK, in every "if", "else" statements, Axis2/C uses
curly brackets even when there is one line of code present under it. BUT in
the above document has code snippets, which does not adhere to that.

don't we have to correct the document?

regards,

Janapriya


[1] http://ws.apache.org/axis2/c/coding_conventions.html

Re: Correct Axis2/C coding conventions.

Posted by Damitha Kumarage <da...@gmail.com>.
Why can't we make it 120. Once we pass 80 limit anyway we have broken 
the old convention.

thanks
Damitha

Manjula Peiris wrote:

>+1 for 100.
>
>-Manjula.
>
>On Mon, 2008-05-05 at 13:54 +0530, Milinda Pathirage wrote:
>  
>
>>Here's my +1 for 100 as the number of columns for line.  Most of the
>>time we need 100 columns or more with the current naming conventions. 
>>
>>Thanks
>>Milinda
>>
>>On Mon, May 5, 2008 at 11:55 AM, Ruwan Janapriya <ja...@wso2.com>
>>wrote:
>>        Yeah, agreed. 100 is better than 80, given that we have long
>>        variable/function names.
>>        
>>        so +1 for that.
>>        
>>        regards,
>>        
>>        Janapriya.
>>        
>>        
>>        
>>        On Mon, May 5, 2008 at 11:43 AM, Damitha Kumarage
>>        <da...@gmail.com> wrote:
>>                Hi,
>>                I suggest that number of columns per line should be
>>                100 instead of 80. Specifically as Axis2/C happen to
>>                have long variable/function names because namespace
>>                prefixes 80 columns width
>>                is hardly enough to write readable code.
>>                
>>                thoughts?
>>                thanks
>>                Damitha
>>                
>>                
>>                Ruwan Janapriya wrote:
>>                
>>                        Hi All,
>>                        
>>                        Following is extracted from Axis2/C coding
>>                        convention document [1].
>>                        
>>                        " 4. Function Parameters and Return Value
>>                        Conventions
>>                        
>>                             Each function should be passed a pointer
>>                        to an instance of the axutil_env_t struct as
>>                        the *first *parameter. If the function is
>>                        tightly bound to a struct, the *second
>>                        *parameter is a pointer to an instance of that
>>                        struct. "
>>                        
>>                        But almost all the functions implemented in
>>                        Axis2/C, axutil_env_t is passed as the *second
>>                        *parameter if there is a tightly bound struct
>>                        available(that struct would be the *first
>>                        *parameter).
>>                        
>>                        Further to above, AFAIK, in every "if", "else"
>>                        statements, Axis2/C uses curly brackets even
>>                        when there is one line of code present under
>>                        it. BUT in the above document has code
>>                        snippets, which does not adhere to that.
>>                        
>>                        don't we have to correct the document?
>>                        
>>                        regards,
>>                        
>>                        Janapriya
>>                        
>>                        
>>                        [1]
>>                        http://ws.apache.org/axis2/c/coding_conventions.html
>>                
>>                
>>                
>>                
>>                
>>                ---------------------------------------------------------------------
>>                To unsubscribe, e-mail:
>>                axis-c-dev-unsubscribe@ws.apache.org
>>                For additional commands, e-mail:
>>                axis-c-dev-help@ws.apache.org
>>                
>>                
>>        
>>        
>>
>>
>>
>>-- 
>>http://inf-dimensions.blogspot.com "Infinite Dimensions"
>>http://wsaxc.blogspot.com "Web Services With Axis2/C"
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
>For additional commands, e-mail: axis-c-dev-help@ws.apache.org
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


Re: Correct Axis2/C coding conventions.

Posted by Manjula Peiris <ma...@wso2.com>.
+1 for 100.

-Manjula.

On Mon, 2008-05-05 at 13:54 +0530, Milinda Pathirage wrote:
> Here's my +1 for 100 as the number of columns for line.  Most of the
> time we need 100 columns or more with the current naming conventions. 
> 
> Thanks
> Milinda
> 
> On Mon, May 5, 2008 at 11:55 AM, Ruwan Janapriya <ja...@wso2.com>
> wrote:
>         Yeah, agreed. 100 is better than 80, given that we have long
>         variable/function names.
>         
>         so +1 for that.
>         
>         regards,
>         
>         Janapriya.
>         
>         
>         
>         On Mon, May 5, 2008 at 11:43 AM, Damitha Kumarage
>         <da...@gmail.com> wrote:
>                 Hi,
>                 I suggest that number of columns per line should be
>                 100 instead of 80. Specifically as Axis2/C happen to
>                 have long variable/function names because namespace
>                 prefixes 80 columns width
>                 is hardly enough to write readable code.
>                 
>                 thoughts?
>                 thanks
>                 Damitha
>                 
>                 
>                 Ruwan Janapriya wrote:
>                 
>                         Hi All,
>                         
>                         Following is extracted from Axis2/C coding
>                         convention document [1].
>                         
>                         " 4. Function Parameters and Return Value
>                         Conventions
>                         
>                              Each function should be passed a pointer
>                         to an instance of the axutil_env_t struct as
>                         the *first *parameter. If the function is
>                         tightly bound to a struct, the *second
>                         *parameter is a pointer to an instance of that
>                         struct. "
>                         
>                         But almost all the functions implemented in
>                         Axis2/C, axutil_env_t is passed as the *second
>                         *parameter if there is a tightly bound struct
>                         available(that struct would be the *first
>                         *parameter).
>                         
>                         Further to above, AFAIK, in every "if", "else"
>                         statements, Axis2/C uses curly brackets even
>                         when there is one line of code present under
>                         it. BUT in the above document has code
>                         snippets, which does not adhere to that.
>                         
>                         don't we have to correct the document?
>                         
>                         regards,
>                         
>                         Janapriya
>                         
>                         
>                         [1]
>                         http://ws.apache.org/axis2/c/coding_conventions.html
>                 
>                 
>                 
>                 
>                 
>                 ---------------------------------------------------------------------
>                 To unsubscribe, e-mail:
>                 axis-c-dev-unsubscribe@ws.apache.org
>                 For additional commands, e-mail:
>                 axis-c-dev-help@ws.apache.org
>                 
>                 
>         
>         
> 
> 
> 
> -- 
> http://inf-dimensions.blogspot.com "Infinite Dimensions"
> http://wsaxc.blogspot.com "Web Services With Axis2/C"


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


Re: Correct Axis2/C coding conventions.

Posted by Milinda Pathirage <mi...@gmail.com>.
Here's my +1 for 100 as the number of columns for line.  Most of the time we
need 100 columns or more with the current naming conventions.

Thanks
Milinda

On Mon, May 5, 2008 at 11:55 AM, Ruwan Janapriya <ja...@wso2.com> wrote:

> Yeah, agreed. 100 is better than 80, given that we have long
> variable/function names.
>
> so +1 for that.
>
> regards,
>
> Janapriya.
>
>
> On Mon, May 5, 2008 at 11:43 AM, Damitha Kumarage <da...@gmail.com>
> wrote:
>
> > Hi,
> > I suggest that number of columns per line should be 100 instead of 80.
> > Specifically as Axis2/C happen to have long variable/function names because
> > namespace prefixes 80 columns width
> > is hardly enough to write readable code.
> >
> > thoughts?
> > thanks
> > Damitha
> >
> > Ruwan Janapriya wrote:
> >
> >  Hi All,
> > >
> > > Following is extracted from Axis2/C coding convention document [1].
> > >
> > > " 4. Function Parameters and Return Value Conventions
> > >
> > >      Each function should be passed a pointer to an instance of the
> > > axutil_env_t struct as the *first *parameter. If the function is tightly
> > > bound to a struct, the *second *parameter is a pointer to an instance of
> > > that struct. "
> > >
> > > But almost all the functions implemented in Axis2/C, axutil_env_t is
> > > passed as the *second *parameter if there is a tightly bound struct
> > > available(that struct would be the *first *parameter).
> > >
> > > Further to above, AFAIK, in every "if", "else" statements, Axis2/C
> > > uses curly brackets even when there is one line of code present under it.
> > > BUT in the above document has code snippets, which does not adhere to that.
> > >
> > > don't we have to correct the document?
> > >
> > > regards,
> > >
> > > Janapriya
> > >
> > >
> > > [1] http://ws.apache.org/axis2/c/coding_conventions.html
> > >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-c-dev-help@ws.apache.org
> >
> >
>


-- 
http://inf-dimensions.blogspot.com "Infinite Dimensions"
http://wsaxc.blogspot.com "Web Services With Axis2/C"

Re: Correct Axis2/C coding conventions.

Posted by Ruwan Janapriya <ja...@wso2.com>.
Yeah, agreed. 100 is better than 80, given that we have long
variable/function names.

so +1 for that.

regards,

Janapriya.

On Mon, May 5, 2008 at 11:43 AM, Damitha Kumarage <da...@gmail.com>
wrote:

> Hi,
> I suggest that number of columns per line should be 100 instead of 80.
> Specifically as Axis2/C happen to have long variable/function names because
> namespace prefixes 80 columns width
> is hardly enough to write readable code.
>
> thoughts?
> thanks
> Damitha
>
> Ruwan Janapriya wrote:
>
>  Hi All,
> >
> > Following is extracted from Axis2/C coding convention document [1].
> >
> > " 4. Function Parameters and Return Value Conventions
> >
> >      Each function should be passed a pointer to an instance of the
> > axutil_env_t struct as the *first *parameter. If the function is tightly
> > bound to a struct, the *second *parameter is a pointer to an instance of
> > that struct. "
> >
> > But almost all the functions implemented in Axis2/C, axutil_env_t is
> > passed as the *second *parameter if there is a tightly bound struct
> > available(that struct would be the *first *parameter).
> >
> > Further to above, AFAIK, in every "if", "else" statements, Axis2/C uses
> > curly brackets even when there is one line of code present under it. BUT in
> > the above document has code snippets, which does not adhere to that.
> >
> > don't we have to correct the document?
> >
> > regards,
> >
> > Janapriya
> >
> >
> > [1] http://ws.apache.org/axis2/c/coding_conventions.html
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-dev-help@ws.apache.org
>
>

Re: Correct Axis2/C coding conventions.

Posted by Damitha Kumarage <da...@gmail.com>.
Hi,
I suggest that number of columns per line should be 100 instead of 80. 
Specifically as Axis2/C happen to have long variable/function names 
because namespace prefixes 80 columns width
is hardly enough to write readable code.

thoughts?
thanks
Damitha
Ruwan Janapriya wrote:

> Hi All,
>
> Following is extracted from Axis2/C coding convention document [1].
>
> " 4. Function Parameters and Return Value Conventions
>
>       Each function should be passed a pointer to an instance of the 
> axutil_env_t struct as the *first *parameter. If the function is 
> tightly bound to a struct, the *second *parameter is a pointer to an 
> instance of that struct. "
>
> But almost all the functions implemented in Axis2/C, axutil_env_t is 
> passed as the *second *parameter if there is a tightly bound struct 
> available(that struct would be the *first *parameter).
>
> Further to above, AFAIK, in every "if", "else" statements, Axis2/C 
> uses curly brackets even when there is one line of code present under 
> it. BUT in the above document has code snippets, which does not adhere 
> to that.
>
> don't we have to correct the document?
>
> regards,
>
> Janapriya
>
>
> [1] http://ws.apache.org/axis2/c/coding_conventions.html



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


Re: Correct Axis2/C coding conventions.

Posted by Ruwan Janapriya <ja...@wso2.com>.
>
> We need to. And you can help :)
>
> Samisa...
>

Sure! I would be happy to help.

regards,

Janapriya.

Re: Correct Axis2/C coding conventions.

Posted by Samisa Abeysinghe <sa...@wso2.com>.
Ruwan Janapriya wrote:
> Hi All,
>
> Following is extracted from Axis2/C coding convention document [1].
>
> " 4. Function Parameters and Return Value Conventions
>
>       Each function should be passed a pointer to an instance of the 
> axutil_env_t struct as the *first *parameter. If the function is 
> tightly bound to a struct, the *second *parameter is a pointer to an 
> instance of that struct. "
>
> But almost all the functions implemented in Axis2/C, axutil_env_t is 
> passed as the *second *parameter if there is a tightly bound struct 
> available(that struct would be the *first *parameter).

I think the document is outdated and needs fixing. We later changed this 
convention, that if is it a "member" function of a struct, then the 
first param should be the pointer to struct and the second should be env 
always.
If it is a non member function, env would be the first.
>
> Further to above, AFAIK, in every "if", "else" statements, Axis2/C 
> uses curly brackets even when there is one line of code present under 
> it. BUT in the above document has code snippets, which does not adhere 
> to that.
>
> don't we have to correct the document?

We need to. And you can help :)

Samisa...


>
> regards,
>
> Janapriya
>
>
> [1] http://ws.apache.org/axis2/c/coding_conventions.html
> ------------------------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG. 
> Version: 7.5.524 / Virus Database: 269.23.8/1413 - Release Date: 5/3/2008 11:22 AM
>   


-- 
Samisa Abeysinghe 
Director, Engineering; WSO2 Inc.

http://www.wso2.com/ - "The Open Source SOA Company"


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org