4 ms·
dynamic_cast<MyData>(funky_iterator<MyData &const>(foo::iterator_type<MyData>(obj)) Yeah. Right. Don't get me wrong, I love templates, but contemporary C++ usin
by robot 15y ago
dynamic_cast<MyData>(funky_iterator<MyData &const>(foo::iterator_type<MyData>(obj))
Yeah. Right.
Don't get me wrong, I love templates, but contemporary C++ using STL looks like a classic case of the "If all you have is a hammer"-syndrome. GCC had to implement special diagnostic simplifications just so you can actually find out that that 5-line error message was a simple const'ness mistake when using a std::string method. Even worse, they can be slow as hell. Ever waited for Boost to compile? Good idea, bad realization.
I have been programming (in C) for 12 years, and when I see something like this I still get a shivering feeling. How can one design such a shitty programming language like this?
- cageface 15y agoEvery language has its pathological corner cases. Modern C++ using the STL is almost as terse as modern dynamic languages but runs 100x faster.
- j_baker 15y agoI would argue that C++ is a pathological corner case.
- cageface 15y agoEven Stroustrup has said there's a cleaner, simpler language within C++ struggling to get out. But C++11 is a big step toward that language and C++ is still the go-to language for a large class of applications for good reason.
- malkia 15y agoYup. It runs x1000 faster than luajit, on a x1000 faster machine that is...
- beagle3 15y agoModern C++11 might (I do not know enough; I'm waiting for examples to pop up), but it's only been finalized for 3 months and not yet implemented fully by any compiler. I suspect it's "only" x2 longer. And about the 100x faster -- you might want to re-evaluate dynamic languages if that was the case last time you tried. LuaJIT2 loses to C++ in most comparisons, but only by 20% or so, while being much more dynamic than Java. V8 is about x3 slower than C++ in real life benchmarks. PyPy in my experience is about x5, Python x10. That's significant slowdown, but it is a far cry from x100, and they are a thousand times easier to develop in than C++. My weapons of choice: Python when it doesn't need to be very fast, Cython when you need to speed that Python up, C [not ++] when you really want it to run quickly and have full control. And K when you want to have fun.