3 ms·
Is this guy serious or joking? "Have you ever used the STL? I did for about 6 months professionally, and I'm glad that I could go back to C and Python. More se
by dhruvbird 15y ago
Is this guy serious or joking?
"Have you ever used the STL? I did for about 6 months professionally, and I'm glad that I could go back to C and Python. More seriously, object orientation in C++ doesn't come for free. Aside from the pain of the syntax of using C++ templates (and difficult to parse error messages), all of that object orientation hides the complexity of method dispatch in what are known as vtables."
Seriously?
1. Python is faster than C++?
2. All OO features (method invocations) in C++ use the vtable?
IMHO, just using the right iterator abstraction and using the STL algorithms should be within performance limits.
- brown9-2 15y agoIt doesn't say python is faster than C++, just that it's easier to write.
- DrJosiah 15y ago"Using C, I wrote a handful of lines of C code that took a sorted sequence of 4-byte integers that represented a Twitter user's followers, and I intersected that sequence against thousands of other similar sequences for other Twitter users." In this case, a custom C algorithm is very fast. I didn't implement the C++ version, but I theorized that the C++ version would be slower because I'd already implemented the C++ algorithm first, and it was slower than what I ended up with. I've also updated the article to remove the vtable stuff.