[concurrency-interest] ConcurrentHashMapV8

√iktor Ҡlang viktor.klang at gmail.com
Mon Oct 3 14:23:43 EDT 2011


On Mon, Oct 3, 2011 at 8:07 PM, Kasper Nielsen <kasper at kav.dk> wrote:

> On 03-10-2011 19:20, √iktor Ҡlang wrote:
>
>>    Adding 1 interface is better then adding 2.
>>
>>
>> According to what definition of "better"? To be honest, if we'd have
>> more fine grained interfaces in Java, we would probably not be in this
>> situation we are in today, where the Collection interface is so broad
>> you oftentimes have to choose between performance or add
>> UnsupportedOperationExceptions**.
>> If we'd have more fine-grained interfaces (or typeclasses) we could be
>> more selective in what data gets exposed.
>>
>
>
Mate, you've completely sidetracked here, would have much appreciated if we
could stay on topic, I believe I made several points that you chose to skip
in your reply.


> According to the design goals of the Java collection framework.
> http://download.oracle.com/**javase/1.4.2/docs/guide/**
> collections/overview.html<http://download.oracle.com/javase/1.4.2/docs/guide/collections/overview.html>,
> 1 interface is "better" than 2.
>
> I know things are probably different in Scala land. But i do think the
> designers of the Java collection API made the right choices with regards to
> this. Is it perfect? no. But I would rather have 10 interfaces with optional
> operations not capturing distinctions such as modifiability than 20 - 30
> interfaces that did. Others might disagree, but I really do not think it was
> a mistake as you are implying.
>

II used to have the exact same opinion, then I found something better. We
should never be afraid of questioning the status quo out of fear of change.


>
> Do it places a burden on implementors, yes. But for every time there is one
> person implementing the Collection interface there are probably thousands
> that are merely users of that interface.
>

I think it's beneficial to let the compiler enforce contracts than having to
surrender to runtime exceptions.


>
> I really think too many API designers think too much on taxonomy and to
> little of the "conceptual weight" of the APIs they design.
>

Those two things are completely orthogonal so there's no reason not to
strive for both.


>
> Hey! there are users that need to figure out how that APIs work. Whether
> there are 10 interfaces or 20 - 30 interfaces matters to them.
>

The number of interfaces isn't nearly as interesting as the number of
methods. I'd rather have a 1000 interfaces with 10 methods than 10000
methods in 1 interface.


>
> Anyway, this is probably not the right forum do discuss this. And we are
> probably not going to come to any kind of agreement on this anyway.


I think that's a bit of a shame, since I opened the door by considering to
add hash as an optional override in Equivalence.

Cheers,
√


>
>
> cheers
>  Kasper
> ______________________________**_________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.**oswego.edu <Concurrency-interest at cs.oswego.edu>
> http://cs.oswego.edu/mailman/**listinfo/concurrency-interest<http://cs.oswego.edu/mailman/listinfo/concurrency-interest>
>



-- 
Viktor Klang

Akka Tech Lead
Typesafe <http://www.typesafe.com/> - Enterprise-Grade Scala from the
Experts

Twitter: @viktorklang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20111003/93294dc2/attachment.html>


More information about the Concurrency-interest mailing list