Thursday, February 24, 2005

The STL in Java

One of the most pleasurable parts of C++ is the STL. Some benighted souls have created Java equivalents in the JGA project now that JDK 5 has generics. If this excites you, read what you can do with iterators and functors. It is not as elegant as C++, but the idioms are much more functional than most Java coders are used to. Until Java has closures, it will do.

UPDATE: I do not want to give the wrong impression. JGA is quite nice for what it is trying to do. The inelegancies that crop up are due to Java, not JGA. It is the same old story: trying to use anonymous classes for closures, lack of mixins, et al. If you want a more elegant version of Java, try Scala or Nice. But do try JGA for your Java projects.

Post a Comment