You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Colin Chalmers <co...@maxware.nl> on 2003/04/24 19:51:16 UTC

Coding Conventions

Hi,

I have a couple of questions regarding the coding conventions

1. Across in AvalonProject I see that use is made of the final word for
method parameters such as

private void foo (final String foo1, final String foo2)

Is this something that should be adopted for Turbine?

2. Is there a preference for return values? ie an Empty String instead of
null??


Colin



---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: Coding Conventions

Posted by Colin Chalmers <co...@maxware.nl>.
> >I have a couple of questions regarding the coding conventions
>
> >1. Across in AvalonProject I see that use is made of the final word for
> >method parameters such as
>
> >private void foo (final String foo1, final String foo2)
>
> >Is this something that should be adopted for Turbine?
>
> Any real reason for this? Besides "cosmetics"?

Here's the answer I got from Avalon newsgroup when I posted the same
question a while ago

<snip>
It is generally recomended that pass-by-value parameters to methods are not
reassigned in the method/function body because it can cause uneeded
complexity when reading code. The advantage of using final to mark these
parameters is that it enforces this rule.

--
Cheers,

Peter Donald

</snip>


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: Coding Conventions

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
"Colin Chalmers" <co...@maxware.nl> writes:

>Hi,

>I have a couple of questions regarding the coding conventions

>1. Across in AvalonProject I see that use is made of the final word for
>method parameters such as

>private void foo (final String foo1, final String foo2)

>Is this something that should be adopted for Turbine?

Any real reason for this? Besides "cosmetics"?

>2. Is there a preference for return values? ie an Empty String instead of
>null??

I prefer "null" over the empty string, because the empty string might
be a valid value e.g. for a string property.

	Regards
		Henning

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/

Java, perl, Solaris, Linux, xSP Consulting, Web Services 
freelance consultant -- Jakarta Turbine Development  -- hero for hire

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org