Menu

#298 Description of delete method in Array class is confusing

5.0.1
open
nobody
None
1
2024-08-03
2023-04-09
No

Rexxref 5.3.6.9: "All elements following the deleted item will be moved up in the array ordering and the item indexes will be adjusted for the deletion". It's unclear what "up" means in this context, since what the elements get, in reality, is a smaller index (one has to think that the first element is at the "top" to make any sense of "up"). Most people would agree, on the other hand, that one-dimensional arrays (that is, vectors) go from left to right. Hence, I propose that the description is changed to "moved left".

Discussion

  • Josep Maria Blasco

    On closer inspection, this seems the result of a copypaste from (1) the corresponding method in the Queue class (where the idea that there is a first or top element makes sense, i.e., imagining a queue as a vertical entity can make some sense), then (2) to the List class (lists, i.e., sequences, are normally thought to be left-to right, not top-to-bottom, like queues) and then (3), finally, to the Array class.

     
  • Josep Maria Blasco

    A single-word update patch.

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.