[ImageJ-devel] Some Naming Issues in imglib2

Lee Kamentsky leek at broadinstitute.org
Tue Jun 7 09:41:36 CDT 2011


Since you asked - this falls under my "Deck chairs on the Titanic" 
category of things to do. ImageJ2.0 isn't the Titanic by any means, but 
we are under a lot of time pressure and, when you shift the deck chairs 
on a file I have modified and am about to check in, it's like I'm 
walking around on the Titanic and the power's gone out and I'm tripping 
over all the deck chairs you've moved.

So, IMHO, don't do it. Can you live with it? Does it gnaw at you until 
your eyeballs start to bleed? No? It's probably ok. I bet, over time, 
you begin to grow to like min and max and lower and upper would feel 
really wrong. My fingers have already grown accustomed to min and max, 
my code has thousands of min and max and I know, you type shift-alt-R 
and change min to lower and you're done, but what about me if I have 15 
files checked out and this breaks all of them?

So, IMHO don't do it.

--Lee

PS: Don't do it.

On 6/7/2011 10:31 AM, Grant B. Harris wrote:
> All --
>
> Curtis and I were considering the addition of methods for get/setting 
> the display scaling values and this drew our attention to some naming 
> issues that we may want to address. There are problems with both 
> semantics and style.
>
> -- Semantics of Interval min/max:
>
> In ImgPlus there are several methods names min and max which inherit 
> from Interval. Semantically, 'min' and 'max' should really be 'lower' 
> and 'upper' (or low/high, or lo/hi), as these fields refer to the 
> bounds or endpoints of an interval, whereas minima/maxima refer to the 
> smallest/largest values of a set or function.
>
> -- Consistency, or lack thereof, with Accessors, Mutators, Creators…
>
> We have generally used the naming style for accessors and mutators 
> (for data encapsulation), but there are many exceptions. While 
> getters/setters lengthens the calls, it really clarifies what a method 
> does. There are numerous other classes where we are inconsistent in 
> naming. For instance, in ImgPlus, get/set is not consistent for 
> dimension(), dimensions(), axis(d), axes(), and calibration(d). And 
> given that the methods cursor(), factory() and iterator() return newly 
> created objects, they should be createCursor(), createFactory() and 
> createIterator() respectively. Such changes would probably best be 
> propagated back into the ancestors of ImgPlus.
>
> And there are, no doubt, other places where there are naming 
> inconsistencies, so if we decide to make changes we should probably 
> run a more thorough review.
>
> These seem like significant inconsistencies which we should either fix 
> now or decide to live with. What do you all think?
>
> -- Grant & Curtis
>
>
> _______________________________________________
> ImageJ-devel mailing list
> ImageJ-devel at imagejdev.org
> http://imagejdev.org/mailman/listinfo/imagej-devel





More information about the ImageJ-devel mailing list