Re: effects of "final" in parameters
- From: Andrew McDonagh <news@xxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 28 Feb 2006 19:40:02 +0000
Chris Uppal wrote:
tom fredriksen wrote:
- how often is "final" actually used in code to make parameters
immutable?
Note that it doesn't make the referred-to object immutable, it just means that
you can't assign another object ref to the parameter variable.
Some people seem to use it a lot. I consider it pointless myself. (Unless, of
course, I /have/ to use it to satisfy the compiler that an inner class won't
break if it refers to the parameter). If I don't want to change the value of a
parameter then I don't change it -- adding decoration to tell the compiler that
I don't intend to change it, so that it can then check that I don't change it,
seems a singularly unproductive exercise.
The voice of reason - thank you Chris!
The amount of times I've tried explaining this to others...... (walks away shaking his head...)
.
- References:
- effects of "final" in parameters
- From: tom fredriksen
- Re: effects of "final" in parameters
- From: Chris Uppal
- effects of "final" in parameters
- Prev by Date: Re: native compiler for java on aix
- Next by Date: Re: How do java programmers cope with java missing c++ const?
- Previous by thread: Re: effects of "final" in parameters
- Next by thread: Re: effects of "final" in parameters
- Index(es):
Relevant Pages
|