# [VOTE] Straw poll: Naming pattern to use for Deque RFC

- Thread: https://externals.io/message/116875
- Original archive: https://news-web.php.net/php.internals/116875
- Started by tyson andre on 2022-01-12T13:52:59+00:00
- Messages: 1
- RFC: Namespaces in bundled PHP extensions (Accepted) — https://externals.io/rfc/namespaces_in_bundled_extensions.md
- RFC: final class Deque (Inactive) — https://externals.io/rfc/deque.md
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #116875 — tyson andre — 2022-01-12T13:52:59+00:00

URL: https://externals.io/message/116875#116875

Hi internals,

Voting has started on https://wiki.php.net/rfc/deque_straw_poll , to gather feedback on the following options:

1. `\Deque`, the name currently used in the RFC/implementation.
   See https://wiki.php.net/rfc/deque#global_namespace
   This was my preference because it was short,
   making it easy to remember and convenient to use.
2. `\Collections\Deque` - seems like a reasonable choice of name for collections 
   (Deque, and possible future additions such as Vector, Set, Map, Sorted Sets/Maps, etc.
   https://wiki.php.net/rfc/namespaces_in_bundled_extensions also allows using sub-namespaces 
   and that may be used for things that aren't strictly collections,
   e.g. `Collections\Builder\SomethingBuilder` or functions operating on collections.
3. `\SplDeque`, similar to datastructures added to the Spl in PHP 5.3.

   (I don't prefer that name because SplDoublyLinkedList, SplStack,
   and SplQueue are subclasses of a doubly linked list with poor performance
   (accessing the offset in the middle of a linked list requires traversing half the linked list, for example),
   and this name would easily get confused with them (e.g. leading to renamings unexpectedly making performance much worse). 
   Also, historically, none of the functionality with that naming pattern has been final.
   However, good documentation (e.g. suggesting `*Deque` instead where possible in the manual)
   would make that less of an issue.)
   
Previous threads:
- https://externals.io/message/116112 “(Planned) Straw poll: Naming pattern for `*Deque`”
- https://externals.io/message/116100 Adding `final class Deque` to PHP

Thanks,
Tyson
