I've been thinking about this over the past few weeks, and I've come up with no good arguments. My perspective is from Java, but if anyone has any language-specific cases outside of this language, I'd love to hear them.
It seems to me that the benefit of using a List over a Deque comes from the fact that one can access the elements within directly via index numbers. While I can see the use in something like a UI (e.g. having a drag-and-drop sortable list), when talking about pure code interaction I see three cases for this:
Iteration. Iterating with a
size()is expensive in most implementations, and can usually be better done with
iterator(), which is present in every
Lookup by index. This usually requires a table of indices and a fixed length list, in which case one would get better performance out of an array.
Operating on the front or back of a
List. This is what
Dequewas designed for, and it doesn't require any calls to
Collections support is nice, but the only thing I could find offhand that was implemented in
Collections but not
Arrays was a
shuffle() function, which is fairly simple for an experienced programmer to implement (or delegate to
Collections, since the overhead for non-primitive arrays isn't too bad IMO).
I feel that everything that one would need a
List for can be better filled by either a
Deque or an array. I've done some searching for comparisons, but the only info I've found either doesn't really discuss
Deques or is written as a "Welcome to Programming" thing and doesn't offer a direct comparison of use cases. I've looked over my code for the past few years and haven't found any
Lists outside of UI elements; I usually use a
Set or a
BlockingQueue for storing variable-length data.