On Sun, Jan 30, 2011 at 10:05 AM, Mikkel Meyer Andersen <m...@mikl.dk> wrote: > Thanks for clearifying :). > Den 30/01/2011 16.01 skrev "Gilles Sadowski" <gil...@harfang.homelinux.org>: >> On Sun, Jan 30, 2011 at 02:58:43PM +0100, Mikkel Meyer Andersen wrote: >>> Hi, >>> >>> 2011/1/30 Gilles Sadowski <gil...@harfang.homelinux.org>: >>> > Hello. >>> > >>> >> I noticed that you have code where fields and constructor arguments >>> >> have the same name. As far as I remember that is not good practise, >>> >> but I might be wrong :-)? >>> > >>> > Most (all?) of CM follows this convention. >>> Just to be sure: Do you mean that in most of CM, parameter and field >>> names coincide? >> >> Yes. >> See, for example, >> > src/main/java/org/apache/commons/math/ode/nonstiff/AdaptiveStepsizeIntegrator.java >> src/main/java/org/apache/commons/math/geometry/Rotation.java >> I think that the list is quite long... >>
When what is being set is exactly the field value and this name makes sense in the public constructor, I see nothing wrong with it. As Stephen said, IDEs and static analyzers will ensure that we do not omit the reference to the instance. What is more important is that the field and parameter names be meaningful and well-documented. Phil --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org