Print

Print


I agree with the generics with large collection classes. I personally use
Trove's collection classes for primitives when they are large and used a
lot. He has gnu classes for lists, sets and maps for all primitive types.
But I am a real fan of using generic collection classes for when they store
objects or are not that small and the main reason is easy of use,
readability of the code and catching of bugs at compile time.
I also read about a back port of all the new classes in Java 1.5 so you can
compile it using java 1.5 and use it in lower Java's, maybe that would be a
nice trade off.

 On 10/22/05, Sean Luke <[log in to unmask]> wrote:
>
> On Sat, 22 Oct 2005, Harri Salakoski wrote:
>
> > Just to clarify that I ported my branch of ecj wich is several years old
> > branch. As much ecj is framework it benefits 1.5 template feature more
> > than average java code. Other hand templates don't help much in low
> > level optimizations like when using integers or raw bytes and I had
> > difficulties with those. There is however
> > "autocapsulation"(Integer->int) feature in 1.5 but I have no glue it
> > performance, I however ported to one ListGenome<T> in vectors package
> > for example. Some of genetic operations still stayed separate per/type.
>
> When Sun said they were going to add generics to Java, I thought that'd be
> a great idea. ECJ's biggest ugliness is in its vector package, where we
> have vectors for numerous data types. But then they decided to go the
> cheapo route and add generics only as syntactic sugar, and worse, if you
> wanted generics for basic types, they had to be boxed (which is enormously
> expensive).
>
> The difference in speed between ArrayList<int> and array[int] is
> unbelievable. :-( Sun really *really* screwed up with generics IMHO.
> There was already a good generics package out there that handled this
> properly, but they rolled their own and blew it.
>
> So, sadly, I've decided not to use the generics in the vector package.
> That and the fact that ECJ tries hard to be backward-compatible with
> earlier Java versions (even now, Version 13 is compatible with Java 1.2).
>
> Sean
>