I feel that I’m more skilled in C++ because I developed a large project in C first. Whether or not C is the language one ultimately chooses, it makes one aware of the tradeoffs and benefits of various coding styles.
void f() {
Vector<int> var1;
}I think c a novice seem much more likely to rely on undefined behavior and have an accidentally working program that leaks memory, fails to check the return value of malloc, close files etc?
That is, one can be sort of productive and "correct" in naive c++ - in c that's not really possible (well, one can be "productive" but correct is less likely?).
I can't be bothered to check the implementation now, but the allocated size must be stored somewhere. My first thought of inferring the capacity as the smallest power of two greater than the used size doesn't work as the vector size can shrink without affecting capacity.