4 ms·
I knew one guy who used C++ but hated STL and most of standard library. He usually implemented data structures in-place as he need them (linked list, growable a
by vbezhenar 8y ago
I knew one guy who used C++ but hated STL and most of standard library. He usually implemented data structures in-place as he need them (linked list, growable array, etc). While it seems strange to reimplement similar data structure over and over again, it worked for him. And one particularly wonderful thing was how fast his projects compiled. He had one project with few libraries, around 100k lines and it compiled very fast, something like second from the scratch and it was 10 years ago.
- jki275 8y agoThat's the way I learned C++. While I mostly use the STL now as it's much more convenient to write, there is an elegance to writing one's own tools.
- sam0x17 8y agoyou'd also be shocked, SHOCKED at how inefficient some of the STL implementations of basic data structure algorithms are
- chillee 8y agoOf special note is the unordered_map/unordered_set implementations. https://news.ycombinator.com/item?id=7849213#7849607 https://news.ycombinator.com/item?id=7849213#7849607
- sam0x17 8y agoimagine all the CS research that relies on the STL expecting it to behave optimally
- jki275 8y agoI've almost purposely avoided studying what the STL does because of that. I have some of my own notions on how some of the data structures ought to be built in order to be efficient, and sometimes I implement them myself to be sure I get the behavior I want.