Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Early in C++'s existence, C++ took a lot of crap from C programmers regarding performance. In those days, C programmers complained of the "overhead" of virtual function calls... and the "bloat" of objects.. As a result, the C++ community became super focused on performance... Most of the features in C++ are completely opt in (I.E, if virtual functions are too expensive, you are free to not use them and not pay any penalty)... This attitude bled into the STL...

Another factor that complicates the STL is it's approach to generic programming... In my opinion C++ took the purists approach (instead of the pragmatic one)... So, std::list doesn't have a .sort() method... Instead, you can use the sort algorithm on any container that implements the right kind of iterators...

IMHO, C++ needs 2 standard libraries... One for purists, and one for pragmatists... (and the pragmatists will use the STL to implement their standard library, but the pragmatist::list will definitely just have a .sort() method!)...



Thus the following quote:

"Whenever the C++ language designers had two competing ideas as to how they should solve some problem, they said, "OK, we'll do them both". So the language is too baroque for my taste." -- Donald E Knuth


Actually, std::list does have a sort() method, std::vector doesn't though. std::vector makes you use the other algorithms one, since it's made up of contiguous memory, while std::list isn't.


The C++ standard library for true pragmatists is Python. :) (Not technically correct, but I was making a point.) I'm pragmatic. Or try to be. So in a world where Python and C++ exist I'm going to try very hard to not touch C++ ever again. Life's too short.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: