dcollections 1.0 and 2.0a beta released

Sean Kelly sean at invisibleduck.org
Fri May 21 22:24:17 PDT 2010


Andrei Alexandrescu Wrote:
> 
> I don't know Tango, but Java's containers are a terrible example to 
> follow. Java's container library is a ill-advised design on top of an 
> underpowered language, patched later with some half-understood seeming 
> of genericity. I think Java containers are a huge disservice to the 
> programming community because they foster bad design.

Tango's container library is or was a port of Doug Lea's containers for Java.  While Doug Lea is an absolute master with concurrency, I never liked his container library very much.  As you've said, the common abstractions it draws are weird and not terribly useful.
 
> I need to disagree with that. I've done and I do a ton of binary 
> interoperability stuff. You never expose a generic container interface! 
> Interoperable objects always embody high-level logic that is specific to 
> the application. They might use containers inside, but they invariably 
> expose high-level, application-specific functionality.

This.  Iterators (or ranges) are passed all over the place, but when operating directly on a container I always want to know what kind of container I'm dealing with.  Cost of operations is an issue, I may need to manually sort at some point or be aware that iterators will be invalidated, etc.

Steve has already said he doesn't use the interfaces, and I'm a huge fan of not doing speculative design.  It's invariably wrong and then you get stuck supporting it.  I'd vote to drop the interfaces.  They can always be added back later anyway.


More information about the Digitalmars-d-announce mailing list