3 ms·
One of the criticisms of the C++ standardization efforts is how many of the improvements are quitearcane. But those arcane features aren't necessarily for user
by gumby 7y ago
One of the criticisms of the C++ standardization efforts is how many of the improvements are quitearcane. But those arcane features aren't necessarily for user code but to make library code efficient. Implementations of the standard library are often almost unreadable because of all the weird corner cases and performance optimizations they have to transparently handle.
This can go a long way to improving user code...but of course it's no magic bullet.
- cbetti 7y agoAre you talking about STL interfaces or implementations?
- gumby 7y agoSTL in particular, but it's hardly the only case.
- adrianN 7y agoI really dislike this mindset in the C++ community. The people writing libraries are normal programmers too. They're not some kind of supermen on whom you can load infinite complexity. And it's not like the STL is this amazing piece of software that mere mortals can't beat. Quite the contrary, any sufficiently large piece of software tends to replace the STL at least in parts with their own implementation.
- gumby 7y agoI don't see that that in any way contrasts with what I wrote. The same is true of the C standard library.
- MaxBarraclough 7y agoDo you have an example of what you're thinking of?
- danbolt 7y agoHerb Stutter mentioned once that an advantage of the STL is that it gets you good general-purpose performance initially, but tries to stay out of your way if you want to replace it for something more specialized. I think you’re right about a codebase replacing parts of STL as necessary. One I see frequently is `std::array` being wrapped with iterators to be essentially a stack-allocated vector.