3 ms·
The term "vector" represents an ordered collection of elements(ex 3-dim vector is [x,y,z]). A list is flat out incorrect because it is used to refer to linked l
by halayli 2y ago
The term "vector" represents an ordered collection of elements(ex 3-dim vector is [x,y,z]). A list is flat out incorrect because it is used to refer to linked list(std::list), and a collection means a group of objects and that can be anything like a map, set, etc so it's too generic.
Before C++ popularized the term, other programming languages and libraries had already used "vector" to describe similar data structures. For example, Common Lisp has a vector type that represents a one-dimensional array.
- Maxatar 2y agoStepanov introduced the term in C++ and he fully acknowledges that it was a bad name and that he regrets it. If he could redo it, he would have renamed it array or array_list. Interview with him acknowledging this: https://www.youtube.com/watch?v=etZgaSjzqlU https://www.youtube.com/watch?v=etZgaSjzqlU
- Y_Y 2y agoIt doesn't help that mathematics and physics have their own overlapping but unequal definitions of "vector".
- microtherion 2y agoAs does Biology. And computing has interrupt vectors as well.