I 100% agree with the title, but some of the complaints in this article have been addressed since the article was published by C++11, C++14, or C++17. Others are just weird.<p>> If you've heard anything about C++, you've probably heard that there's no standard string class and everybody rolls their own.<p>Is this still true? std::string seems perfectly reasonable now, especially now that they've given up on supporting ropes and integrated the small string optimization. Yes it doesn't specify an encoding.<p>> No garbage collection? Check. No refcounting? Check. Need to allocate/free heap space just to pass a string constant to a function?<p>Nothing else in the standard library is garbage collected or refcounted by default. Why would std::string be the lone exception? You can opt into refcounting for any type using std::shared_ptr.<p>The objection about allocating/freeing heap space is about APIs that take const std::string& being passed C-string literals. Legitimate complaint, but it's addressed by std::string_view now.<p>> ...rant about lack of []= operator...<p>[] mutating the map does surprise people, so that's definitely a legitimate complaint. And it is annoying to have to use find() in a const context...<p>but simple operations like counting are simpler and more efficient in C++ than in Python because the +=, -=, etc operators work:<p><pre><code> for value in list:
counts[value] = counts.get(value, 0) + 1
</code></pre>
vs<p><pre><code> for (auto& value : list)
counts[value]++;
</code></pre>
> So actually C++ maps are as fast as python maps, assuming your compiler writers are amazingly great, and a) implement the (optional) return-value optimization; b) inline the right stuff; and c) don't screw up their overcomplicated optimizer so that it makes your code randomly not work in other places.<p>This is just comical. Python is not playing in the same performance league as C++, regardless of whether inlining or RVO happens. RVO of course is a general optimization for returning objects by value from functions, not a special case to optimize setting map items. It's still relevant, but less important since C++11's move semantics.