Hi internals,
Voting has started on https://wiki.php.net/rfc/deque_straw_poll , to gather feedback on the following options:
-
\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. -
\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. -
\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