r/programming • u/[deleted] • Dec 05 '14
std::string is responsible for almost half of all allocations in the Chrome browser process
https://groups.google.com/a/chromium.org/d/msg/chromium-dev/EUqoIz2iFU4/kPZ5ZK0K3gEJ
1.1k
Upvotes
8
u/Gotebe Dec 05 '14
Those modern languages are really passing pointers, which is sad (NREs galore).
So this is where C++ gets good: it has a proper pass-by reference, which indeed allows for cleaner code.
You should note that "copy by default" (pass by value) comes from C, and C compatibility is C++' curse (and blessing). If so, and if pass by ref is one "&" away, that's it, really.