Login  Register

Re: Java Generics

Posted by Adrian Daerr on Jun 13, 2007; 7:10am
URL: http://imagej.273.s1.nabble.com/Java-Generics-tp3699132p3699133.html

> On Sat, 9 Jun 2007, Ben Woodcroft wrote:
>> 1.1 compatibility is quite impressive I must say. I guess the price
paid for backwards compatibility is a slower development time for
plugin writers, especially new ones.

Johannes Schindelin replied:
> If at all, it has resulted in slower development _only_ for ImageJ. The
plugins do not suffer from the constraints.

Well, indirectly yes. The source code of plugins itself is indeed not
restricted to old language versions (although you lose the possibility to
"Compile and Run" from within ImageJ if you want newer language features);
but plugins are not self-contained, they rely heavily on ImageJ's objects
and methods, and ImageJ's structures and interfaces could be much more
intuitive to use (by plugin-writers) if they took advantage of newer Java
features. That was actually the main point of Ben's initial posting.

IMHO Ben is right when he says that plugin-writing could faster and more
intuitive (especially for newcomers) with Generics, Enumerations, static
includes (who would not favor
  write("angle="+atan(sqrt(1+x*x)));
over
  IJ.write("angle="+Math.atan(Math.sqrt(1+x*x)));
) et caetera.
And, to answer Dimiter Prodanov's concerns about code speed, these
features, if the change anything at all, may even augment the execution
speed (in Ben's example, the internal Iterable implementation can be more
efficient than hand-made loops, and is in any case unlikely to be worse).
But as Ben says, the loss of elegance and simplicity is probably the price
to pay for being able to run on old machines (which as Jeff argues, is an
important objective).

This said, it might be worth considering the creation of a development
branch of ImageJ. This could be used as playing ground by interested
programmers, and be cannibalized by Wayne whenever interesting ideas are
worth integrating into the original ImageJ. Personnally, I see a couple of
small bugs I'd try to correct straight away if it were as easy as a call
to bzr/darcs/svn/cvs/whatever, editing, and committing the patch.
Does anybody care to share her/his opinion on this ?

best regards,
Adrian

--
http://www.msc.univ-paris-diderot.fr/~daerr/