# \[Second review\] SE-0453: Vector, a fixed size array

**URL:** <https://forums.swift.org/t/second-review-se-0453-vector-a-fixed-size-array/76412>\
**Category:** Proposal Reviews\
**Created:** [December 6, 2024, 4:37am UTC](https://forums.swift.org/t/second-review-se-0453-vector-a-fixed-size-array/76412 "2024-12-06T04:37:37Z")\
**Posts on this page:** 1\
**Showing post:** 71

<div class="post-metadata">

**Author:** ![Andropov](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/andropov/32/35955_2.png) [@Andropov](https://forums.swift.org/u/Andropov)\
**Post date:** [December 10, 2024, 10:13am UTC](https://forums.swift.org/t/second-review-se-0453-vector-a-fixed-size-array/76412/71 "2024-12-10T10:13:16Z")

</div>

> [@ben-cohen](#):
>
> Calling this type `Vector` seems like it will inevitably lead to a kind of "Who's on first" dialog with developers coming to Swift from e.g. C++:

Since the growable type in Swift is named `Array` already, I don't think _"`Array` and `Vector` have swapped meanings in Swift vs C++"_ is any harder to explain than _"`Array` is like a C++ `vector`, and `FixedArray` is like a C++ `array`"_.

In fact, I'd argue that the latter is more confusing to explain to someone coming from C++. An analogous conversation could be:

> — You shouldn't use array here. Array is a dyanically growable type like a C++ vector, it'll incur reference counting and bounds checking even though you know the size at compile time.  
> — OK. So what should I use?  
> — A fixed array.  
> — I thought you said not to use an array!  
> — No, you shouldn't use an array. A fixed array, on the other hand, is like a C++ array.  
> — Isn't fixed array an array?  
> — Well, on Swift both are arrays, but you want a C++ array, which is fixed array specifically, not array, which is like a vector.  
> — _[surprised pikachu face]_

Of course, it helps a lot to add formatting so "`Array`" and "array" look like different things. But that's _really_ hard to do on spoken conversations (or, more generally, when someone is being lazy with formatting).

Actually, a general concern I have with `FixedArray` as a name ([which I also raised during the pitch](https://forums.swift.org/t/vector-a-fixed-size-array/75264/221)) is that it clashes with any statements of the form _"arrays in Swift do X and Y..."_ because now you have to second-guess whether that statement applies to only the type `Array` or any other "array" (like `FixedArray`). This could be more palatable if the only difference between `Array` and `Vector` was the fixed length, but there's the inline aspect of it as well. Seems to me that `Array` is fundamentally different enough from `Vector` that these statements are going to create a lot of confusion.

* * *

FWIW, if anything, I think having the names swapped could help discoverability for those coming from C++: upon learning that `Array` is a growable collection type in Swift, it's natural to then go on and search whether "Vector" exists and what it means in Swift, as that's the type C++ programmers would reach for when in need of a growable collection.

---

_[View the full topic](https://forums.swift.org/t/second-review-se-0453-vector-a-fixed-size-array/76412)._
