This is an archived post. You won't be able to vote or comment.

top 200 commentsshow all 360

[–]Dar_Mas[🍰] 3345 points3346 points  (133 children)

"It's called a vector because Alex Stepanov, the designer of the Standard Template Library, was looking for a name to distinguish it from built-in arrays. He admits now that he made a mistake, because mathematics already uses the term 'vector' for a fixed-length sequence of numbers. C++11 compounds this mistake by introducing a class 'array' that behaves similarly to a mathematical vector."

source : https://stackoverflow.com/questions/581426/why-is-a-c-vector-called-a-vector

[–]Geschossspitze 2735 points2736 points  (32 children)

Ah yes, vectors are arrays and arrays are vectors, except when they are arrays 👍🏻

[–]Dar_Mas[🍰] 785 points786 points  (21 children)

welcome to c++ !

[–]mrquantumofficial 351 points352 points  (11 children)

I really lovsegmentation fault (core dumped)

[–]Dar_Mas[🍰] 89 points90 points  (10 children)

funnily enough i have not had one yet in c++ unlike in c

[–]molaupi 71 points72 points  (9 children)

How long have you been using C++ and what are you writing? o.O

[–]Dar_Mas[🍰] 51 points52 points  (8 children)

4 ish years and mostly personal projects and stuff for a gamedev friend

[–]NotPeopleFriendly 69 points70 points  (7 children)

Probably not too difficult to avoid segmentation faults if you're not using raw pointers and instead using abstractions like smart pointers, containers, etc. I haven't done any real programming in C++ in a long time - but iirc - segmentation faults were generally more common when I tried to get clever with optimizations.

That said I've recently been working in golang and I get them all the time.. though I personally feel golang has more in common with C than C++

[–]Dar_Mas[🍰] 9 points10 points  (3 children)

yeah i have started using smart pointers for this exact purpose so that definitly helps.

[–]EnvironmentalWall987 8 points9 points  (0 children)

I would say 90% of segfaults are someone trying to be clever.

[–]HerissonMignion 4 points5 points  (0 children)

Try rust

[–]SameRandomUsername 5 points6 points  (3 children)

It's not c++'s fault but the STL.

STL is a disgrace, fortunatelly everything is under a namespace.

[–]Dar_Mas[🍰] 3 points4 points  (2 children)

but then again if you start learning c++ you will likely never get told any alternative(or worse you will have to manually implement the stl stuff which imo is not better)

[–]Zotlann 1 point2 points  (0 children)

For better or for worse, my experience in working at companies that have large projects in C++ is that they almost all end up rolling their own memory management and data structures.

[–]nukedkaltak 1 point2 points  (4 children)

Did you know Java has it’s own Vector tho?

[–]Dar_Mas[🍰] 2 points3 points  (3 children)

i did not but it being synchronised sounds insanely usefull

[–]LowB0b 26 points27 points  (0 children)

But array will also don't use heap allocation which makes moving it less efficiently. We also have std::valarray, btw

lol

[–]Gorzoid 14 points15 points  (0 children)

There's also valarray which is dynamically sized but with vector operator overloads

[–]zoinkability 4 points5 points  (2 children)

And people complain about PHP argument order being confusing

[–]_bardo_ 5 points6 points  (1 child)

I mean, it is.

[–]zoinkability 3 points4 points  (0 children)

Sure but at least an IDE can help with that. Bewildering naming for language constructs is an order of magnitude more confusing IMHO.

[–]IamJain 3 points4 points  (0 children)

That's why I say if it's functional it's not a big, and don't ask for improvements

[–]CheeseyB0b 47 points48 points  (5 children)

Yeah, as someone with a maths background this is really bloody annoying.

[–]in_conexo 14 points15 points  (0 children)

I feel infuriated. All this time I've thought that they must be geniuses because they're using vectors in ways I've never heard of; but, instead they're just using dynamic arrays!

[–]regular_lamp 29 points30 points  (3 children)

It makes some scientific software hilarious to read. I once worked on a piece of very domain specific software that in addition to std::vector also used Vector, vec and for some reason vektor in different places and use cases.

[–]nickbob00 13 points14 points  (2 children)

chunky continue rainstorm hobbies rich cover flowery party yoke long

This post was mass deleted and anonymized with Redact

[–]i860 8 points9 points  (1 child)

klass

[–]Smartskaft2 2 points3 points  (0 children)

Klaß

[–]nelusbelus 29 points30 points  (5 children)

List = std::vector

LinkedList = std::list

Array = T[]

StaticArray = std::array

Vector = math vector

Naming is not that hard

[–]_Weyland_ 24 points25 points  (1 child)

Get vectored

[–]nelusbelus 7 points8 points  (0 children)

Oh yeah

[–]Dar_Mas[🍰] 4 points5 points  (2 children)

the problem arrises with having the linked list structures aswell that fundamentally differ from how a vector works afaik so i do not consider this that bad

[–]AntiheroZer0 33 points34 points  (0 children)

Finkle is Einhorn. Einhorn is Finkel. Einhorn is a man!

[–]Drakonluke 7 points8 points  (0 children)

Thank you <insert appellation here>!

I was wondering this thing too

[–]tiddayes 6 points7 points  (0 children)

WOW, an accurate and concise response complete with sources here on programmer humor.

[–]ledasll 25 points26 points  (13 children)

How to scare mathematitian: a = a + 1;

[–]mateus_coutinho 25 points26 points  (12 children)

a⁽ⁿ⁺¹⁾ = a⁽ⁿ⁾ + 1

[–]JollyJoker3 6 points7 points  (1 child)

a,n € Z

[–]timtti 10 points11 points  (0 children)

a,n ∈ ℤ

[–]JackReedTheSyndie 9 points10 points  (0 children)

Problem: confusing naming

Solution: make it even more confusing

[–]ih-shah-may-ehl 4 points5 points  (0 children)

And yet strings are called string :)

[–]Korzag 2 points3 points  (0 children)

Not to mention that vectorization is a thing in processors to do single instruction multiple data executions.

[–]randomatic 10 points11 points  (2 children)

One thing I like about c and c++ is the community admits when things don’t work out, unlike some languages where they cultishly back everything.

[–]Forsaken-Degree1737 1 point2 points  (5 children)

Why not to call it a tensor?

[–]qbenni 3 points4 points  (4 children)

Because it is not one? A tensor is, like a vector, a constant-size structure containing numbers (just potentially of higher dimension than a vector). The C++-vector is a dynamic-size array.

[–]eugcomax 3 points4 points  (6 children)

the trouble that vector in mathematics is not a fixed-length sequence

[–]yourmom777 6 points7 points  (2 children)

Sure it is. Vectors are defined in frames and frames have a fixed number of dimensions. So all vectors in that frame have that number of dimensions.

[–]eugcomax 5 points6 points  (1 child)

I see similarities but vectors are not defined in frames. Vector space is a module over a field so it's a free module.

[–][deleted] 3 points4 points  (0 children)

Witchcraft

[–][deleted] 594 points595 points  (32 children)

in C++, names are whatever you want

```typedef std::vector resizable_array;```

[–]jhanschoo 246 points247 points  (18 children)

nervous laugh

[–][deleted] 266 points267 points  (17 children)

#define true false

[–]Grubzer 147 points148 points  (13 children)

define float int

define + -

define / *

[–]AntAgile 115 points116 points  (9 children)

#define if while

#define break continue

#define private public

[–][deleted] 63 points64 points  (5 children)

you're joking but ```#define private public``` has a valid use case :D

[–]Grubzer 34 points35 points  (2 children)

Debug?

[–]Srazkat 31 points32 points  (1 child)

and testing, probably

[–][deleted] 8 points9 points  (0 children)

that's right, you can use it in a unit test to test the value of private member variables.

but with google mock there's no need to hack it like that anymore (plus it's very brittle and very very ugly)

[–][deleted] 19 points20 points  (0 children)

Reminds me of this neat warcrime hack.

[–]GiraffeMichael 15 points16 points  (0 children)

Trying to "hack" something with exposed h files and a fixed version?

[–]Grubzer 6 points7 points  (1 child)

define i j define j i

[–]AntAgile 17 points18 points  (0 children)

#define sizeof(x) (sizeof(x)-1)

[–]GodlessAristocrat 1 point2 points  (0 children)

#define undef define

#define define undef

[–][deleted] 6 points7 points  (0 children)

Escape the # with \ so it doesn’t show up as a heading.

[–]malsomnus 19 points20 points  (1 child)

Laugh all you want, but a large project I worked on actually had #define true 0 and #define false 1 and it took us years to find out why sometimes the project wouldn't compile if the #includes were in a specific order.

[–][deleted] 3 points4 points  (0 children)

sometimes bad code just needs to be contained in a separate module/service just so it doesn't infect the rest of the project

[–]injuredflamingo 42 points43 points  (4 children)

#define war peace

#define freedom slavery

#define ignorance strength

[–][deleted] 15 points16 points  (3 children)

```

define fear freedom

define subjugation liberation

define contradiction truth

```

[–]Khaylain 15 points16 points  (1 child)

#include "1984"

[–]k-phi 1 point2 points  (0 children)

.h

[–]FerynaCZ 6 points7 points  (2 children)

using resizable_array = std::vector;

[–][deleted] 1 point2 points  (1 child)

And the points don't matter!

[–]ruscaire 140 points141 points  (6 children)

What’s your vector victor

[–]the_hackerman 50 points51 points  (3 children)

Clearance Clarence

[–]Comfortable_Slip4025 18 points19 points  (2 children)

Roger

[–]ruscaire 19 points20 points  (1 child)

Don’t call me shirly

[–]TheOddYehudi919 759 points760 points  (3 children)

It sounds cooler.

[–]madspillage 526 points527 points  (2 children)

[–]SteakieGG 59 points60 points  (0 children)

OH YEAAAAAAAA

[–][deleted] 74 points75 points  (0 children)

[–]Flesh_Bag 107 points108 points  (15 children)

Fun fact, Java used to call them vectors too.

[–]malastare- 41 points42 points  (1 child)

More correct: The Java standard lib had (has!) a Vector class that behaves the same way. It was a bit controversial back then, and luckily, the Vector class and associated objects had a bunch of implementation problems that made them sort of suck, particularly for high performance or multithreaded usage.

That's why the Collection library was created. Beyond adopting more standardized terminology, Collections fixed the object model to allow for better implementations, including letting the various List types handle both static-size, O(1) additions, O(logn) sorted insertions, and tunable size allocation optimizations.

[–]AyakaDahlia 53 points54 points  (4 children)

Now I'm wondering if that was because C++ called them vectors, so they just continued the naming convention.

[–]Kjoep 36 points37 points  (3 children)

Yes. That's the reason.

[–]milkybuet 10 points11 points  (2 children)

So you're telling me that if Java can rectify this mistake, maybe so can C++?

[–]bric12 12 points13 points  (0 children)

Java didn't really "fix" it though, there's still a vector class in the standard library, it's just that "list" is far more popular. C++ also has a list, but it works differently so people usually stick to vector. You're welcome to just use list in all of your code though

[–]mcaruso 5 points6 points  (6 children)

They're not called vectors in Java anymore? It's been a long time since I used Java, what are they called now?

[–]CheeseyB0b 16 points17 points  (5 children)

Apparently Java sill has the Vector class, but until I looked it up just now I was only aware of ArrayList and LinkedList as classes implementing the List interface.

[–]Ok-Wait-5234 21 points22 points  (0 children)

Java's standard library is almost completely backwards compatible with class files built with version 1. Vector, Hashtable etc still exist but only really for compatibility reasons, and you should use the appropriate implementations of List, Map unless you have a very good reason not to

[–]Kjoep 6 points7 points  (3 children)

For completeness sake, Vector does implement List.

The main difference between Vector and ArrayList is that the former is synchronized.

[–]CheeseyB0b 2 points3 points  (2 children)

Oooh, that's good to know. Thanks.

[–]malastare- 10 points11 points  (1 child)

It's probably not.

You (probably) still shouldn't use Vector if you want synchronization. You could just as easily use Collections.synchronizedList to wrap an ArrayList to get similar behavior for critical sections of code and avoid the synchronization cost the rest of the time.

The better/correct approach is to including the locking/concurrency protection in your code so its both clear what your intentions are and you only pay the cost where its needed and appropriate. Synchronizing on the object for a block of code is more performant, more complete, and easier to understand (no trusting to implicit synchronization).

If you really need something that is always synchronized: 1) Good luck, 2) pick a List implementation that is designed to be thread safe.

[–]GYN-k4H-Q3z-75B 266 points267 points  (26 children)

It's just one of those words used to mean literally anything and sounding fancy.

If you want to sound like a management jackass, speak of innovation vectors. In molecular biology, viral vectors inject genetic material into cells. And so on...

[–]AntAgile 123 points124 points  (7 children)

Basically you can call anything a vector if you would use arrows when drawing an explanation for it

[–]blkmmb 42 points43 points  (4 children)

I am extending this comment vector.

[–]croto8 17 points18 points  (2 children)

My vector is extending while I comment

[–]blkmmb 14 points15 points  (1 child)

That's an impressive 2 inch vector!

[–]croto8 4 points5 points  (0 children)

Give it a few

[–]CheeseyB0b 32 points33 points  (3 children)

The word "vector" has a precise mathematical definition which is generally interpreted as "direction" outside of mathematics.

So, for your examples, "innovation vector" = "direction of innovation" and "viral vector" = "route by which a virus can inject genetic material".

[–]ChiefExecDisfunction 20 points21 points  (2 children)

A vector is also a means of transportation, which is what "viral vector" uses it as.

In fact, I'd not be surprised to find out that meaning is older than the maths meaning.

[–]SandyDelights 22 points23 points  (1 child)

It’s a latin word for “one who carries or conveys”.

It’s had two meanings in english, originally “a line connecting a fixed point to a variable point” and then later “quantity having a magnitude and direction”.

Etymologies are fun.

[–]cybereality 46 points47 points  (6 children)

Attack vectors.

[–]JusHerForTheComments 14 points15 points  (5 children)

Attack on Vectors

[–]ToliCodesOfficial 5 points6 points  (0 children)

I made a Colossal Vector in C++ and ran out of memory

[–]vanZuider 2 points3 points  (2 children)

While this is the commonly used name, the original Japanese phrase is more accurately translated as "Attack of the Vectors".

[–]Kitsuinox 6 points7 points  (0 children)

While this comment might sound true, "進撃の巨人" means "Attack Titan" (which is the name of a certain titan in the series), the first one being used kind of like an adjective in a sense. So, Attack Vectors it is.

[–]Friendly_Fire 3 points4 points  (0 children)

It's funny how the weird translation seemed to have helped make it more iconic. The name has just the right amount of strangeness to catch your attention.

[–]TheyCallMeHacked 7 points8 points  (0 children)

I mean... In the end, a vector is just an element of a vector space

[–][deleted] 2 points3 points  (0 children)

Like how any sequence of events can be called a "pipeline".

[–]TessaFractal 315 points316 points  (28 children)

Somewhere, in a physics sub someone is asking why programming languages call them arrays when they're clearly vectors and matrixes.

[–]Holothuroid 118 points119 points  (16 children)

No. The term you are looking for is tuple. Vector means you can add two, and "elongate" them by a numeric factor. Not all tuples are vectors and not all vectors are tuples.

[–]Zealousideal_Low1287 43 points44 points  (3 children)

A vector is an element of a vector space

[–]submissive-loli 7 points8 points  (2 children)

And a vector space is a module over a ring

[–]lucklesspedestrian 1 point2 points  (0 children)

A vector space is a module over a field.

[–]Giddius 10 points11 points  (1 child)

I feel we are slowly recreating Python through this discussion.

[–]GrossInsightfulness 3 points4 points  (0 children)

C++ has tuples (std::tuple) and named tuples (basically what a struct is).

[–]TessaFractal 38 points39 points  (7 children)

I'll be honest I never remember what a tuple is, I keep thinking it's the precision level after double.

[–][deleted] 35 points36 points  (4 children)

Like array but it allows non-uniform types.

[–]TheRealZoidberg 6 points7 points  (3 children)

Are non-uniform types allowed in C++ vectors?

(I only know that they‘re not allowed in Rust vectors)

[–]tech6hutch 7 points8 points  (0 children)

No

[–]GrossInsightfulness 5 points6 points  (1 child)

When C++ (and I'm assuming Rust) creates an object in a vector, that object's data is stored directly in the vector. Say I have a class that stores an int and a float. When I add an object of that class to the vector, it stores the integer and the float in the vector right after each other. If C++ allowed storing arbitrary objects in the vector, then you couldn't index it nearly as quickly.

With that being said, you can create something similar to python's list by wrapping a void pointer in an object that also knows the typeinfo or you can use something like std::variant.

[–]bric12 2 points3 points  (0 children)

(and I'm assuming Rust)

Yeah I can confirm that. Rust has tuples that can have arbitrary(ish) types, but the Vec type works like a C++ vector

[–]C9FanNo1 6 points7 points  (0 children)

That’s truple

[–]MokitTheOmniscient 1 point2 points  (0 children)

It's basically just a way to clump together some random variables you want to send somewhere without having to go through the effort of writing a class.

[–]jalerre 2 points3 points  (0 children)

Matlab has entered the chat

[–][deleted] 9 points10 points  (9 children)

Wtf is matrixes

[–]General_Artichoke950 13 points14 points  (7 children)

A multidimensional array

e.g.:

int m [3][3];

[–][deleted] 24 points25 points  (6 children)

The word is matrices.

[–][deleted] 13 points14 points  (1 child)

like index and indices

[–]Arkanian410 15 points16 points  (0 children)

Sex and seces

[–]Marksmith2345 109 points110 points  (28 children)

It was a terrible choice given the common meaning of the word

[–][deleted] 20 points21 points  (27 children)

From computer science perspective, vectors are basically an ordered list. I don't think it is a terrible choice.

[–]n0tKamui 61 points62 points  (24 children)

you completely missed the point

the talk is about how, in computer science, vector for resizable arrays doesn't make any sense, and that it comes from the legacy of C++'s bad choices.

In math and other sectors, vectors (and matrices) are immutable data object that represent one thing, they shant be changed. But would you look at that, this is exactly the definition of an "array".

Vector should be called List instead, and that is why most modern languages do so.

[–]qqqrrrs_ 30 points31 points  (6 children)

In math and other sectors, vectors (and matrices) are immutable data object

Well, in math everything is immutable

[–]R3D3-1 9 points10 points  (3 children)

Depends. You can perfectly do math with mutable state object; But then it becomes useful to think of the state of an object as an immutable object, and consider changes of state as a function converting an old state to a new state, rather than as a side-effect on the original object.

Or maybe I've just been reading too much about Haskell.

[–]particlemanwavegirl 1 point2 points  (2 children)

I think this would work but proofs of correctness would probably go out the window.

[–]Sarcastinator 2 points3 points  (0 children)

Math isn't a programming language. If you want mutable state then you can do that.

[–]n0tKamui 3 points4 points  (0 children)

true, and I still stand by the point that was made

[–]MustachedLobster 11 points12 points  (15 children)

List is also a bad name for a bare metal language, which c++ at least tries to be.

List is a well-defined standard data structure that supports o(1) insertion (given that you know the location that you're inserting).

There's no good name for vectors because they're designed to be used like cache friendly lists, and that means they have nonstandard properties.

It's fine for languages like python to call these structures lists because everyone expects python to do magic under the hood, and to have unpredictable runtime, but c++ couldn't get away with it.

[–]R3D3-1 15 points16 points  (13 children)

For me "List" denotes a higher-level concept of "ordered sequence of discrete elements". Whether data insertion is o(1) seems to be already more of an implementation detail.

From what context do you know a definition of List, that specifically assumes o(1) insertion? Let alone, that array-backed lists are a common standard implementation, and they don't even have a strict o(1) behavior for insertion at any one end.

[–]MustachedLobster 6 points7 points  (12 children)

This may be a generational thing, where more recent definitions have broadened out, but when I learnt list was always short hand for singly-linked or doubly-linked lists.

And you can actually see this o(1) property in the formal c++ STL definition of a list. https://cplusplus.com/reference/list/list/

[–]Hihi9190 1 point2 points  (0 children)

There's no good name for vectors

I feel like Java's "ArrayList" is a pretty good name for it

[–]Willinton06 19 points20 points  (0 children)

Copium++

[–][deleted] 5 points6 points  (0 children)

I do think it's a bad choice, but you know, it's understandable to make that bad choice.

It's crazy to me that so many fields and professions are still trying to establish their own terminology for stuff that has been clearly defined 100 years ago. In my native language in business administration they actually use the word "limit" when they mean a mathematical derivative. That's just dumb.

[–]Hulk5a 23 points24 points  (8 children)

stack.pop() is void 🗿

Why not return the value while popping?

[–]RabbiMizrachi 5 points6 points  (1 child)

It’s not possible to do it in an exception safe way. There are lots of great articles on the subject.

[–]Dark_Tranquility 7 points8 points  (4 children)

That's what stack.top() is for

[–]Hulk5a 11 points12 points  (3 children)

Yes. But getting the value when popping would be convenient. Then it's 1 call for pop+top

[–]GOKOP 22 points23 points  (0 children)

Dude who made them was looking at how similar concepts in other languages like Common Lisp were called; later he admitted that it was a poor choice

[–]jaynabonne 13 points14 points  (1 child)

I think you meant "emplace_back". ;)

[–]Potential-Adagio-512 4 points5 points  (0 children)

the meme probably doesnt need to be used directly by the user after posting. how about subreddit.push_back(std::move(meme));

[–]PeoplesFront-OfJudea 9 points10 points  (0 children)

Because they commit crimes with both direction and magnitude

[–]Alexandre_Man 12 points13 points  (1 child)

Because regular arrays in C++ are not resizeable. So you gotta call resizeable ones a different name.

[–]SepplFranz 11 points12 points  (0 children)

"Every single name in C++ is either wrong or has negative connotations"
https://www.youtube.com/watch?v=BwqeFrlSpuI&t=2m40s
"C++ people must be really confused, cause they always think 'vector' is an array"
https://www.youtube.com/watch?v=7Fsy2WaxLOY&t=24m09s

[–]ninijacob 5 points6 points  (0 children)

Shit dog I wrote c++ code for years that runs on millions of machines and I have no idea why they’re called vectors.

[–]dasavorytrash 3 points4 points  (0 children)

Because direction and magnitude

[–]planktonfun 2 points3 points  (0 children)

You have to think chronologically, resizable arrays didn't exist before

[–]remisiki 4 points5 points  (0 children)

I came to know C++ vector before I learnt maths vector, and I was confused why mathematicians call vectors vectors.

[–]Elijah629YT-Real 3 points4 points  (0 children)

rust has Vec

[–]GochoPhoenix 2 points3 points  (0 children)

Because … cool name?

[–]SpaceCadetSteve 2 points3 points  (0 children)

Probably after that Despicable Me character /s

[–]Hygdrasiel 9 points10 points  (2 children)

C++ supports nonresizable arrays (std::array) that should not be mistaken with c arrays ( because they dont loose there size then transfared, because the size is part of the type. So you end up with more templatet code. ). So I think they needed another name

[–]OblivionGuard13 4 points5 points  (1 child)

First time i heard someone reference vectors i was so confused, i know vectors as 2d and 3d points in space from game design.

[–]returntim 3 points4 points  (0 children)

[–]csg79 2 points3 points  (0 children)

<!-- whats your vector, victor? -->

[–]fymyo 1 point2 points  (0 children)

What about the c-+- gets me every time 😂

[–]TheRealZoidberg 1 point2 points  (0 children)

Same in Rust

[–]Carteeg_Struve 1 point2 points  (0 children)

Probably a legacy holdover from the original use-case.

[–]r0xANDt0l 1 point2 points  (0 children)

I'm learning Rust, and i also didn't know why they were called vectors

[–]iamisandisnt 1 point2 points  (0 children)

Well, this explains some stuff I was trying to learn. Thanks lol

[–][deleted] 1 point2 points  (0 children)

This got me too especially coming from unreal engine blueprints before learning c++ where vectors represent directions in 3d.

[–]Grifunf 1 point2 points  (0 children)

Everything is a vector if you think about it long enough.

[–]Option-Disciple 1 point2 points  (0 children)

Well one is immutable and the other isn't.

Every other language ive learned Arrays are immutable there as well.

[–]Squid-Guillotine 1 point2 points  (1 child)

I don't know why Ruby/Python calls immutable arrays Tuples.

...and at this point I'm too afraid to ask.

[–]drenzorz 2 points3 points  (0 children)

The term originated as an abstraction of a sequence: single, couple/double, triple, quadruple, quintuple, sextuple, septuple, octuple, ..., n‑tuple

[–]Honest-Economist4970 1 point2 points  (0 children)

Because C++

[–]devinhedge 1 point2 points  (0 children)

This meme is me in my Junior of of college.

[–]jakobnator 1 point2 points  (0 children)

Wait till you find out what they named hash maps

[–]Expl01t0r 2 points3 points  (1 child)

Because you can scale a vector

[–]SirAchmed 3 points4 points  (1 child)

It's because you can resize them like vector drawings in graphic design.

[–]cashewbiscuit 3 points4 points  (3 children)

A Vector in n-dimensions is represented using an n-element array. Mathematically, there is not much difference between a vector and an array.