Hacker News new | ask | show | jobs
by eqvinox 1551 days ago
Just to clarify, the intent in my comment is that a whole bunch of the terms used there aren't "fluid associations" for me as a C developer. There's no issue looking them up, but they aren't what I would choose to name these containers.

(e.g. I would just call it "refcnt_ptr" and "heap" [if it is one], respectively)

1 comments

shared_ptr is more special than a simple ref count though, it performs some level of mandatory thread synchronization for example; it's a C++-specific concept.

The STL was designed by A. Stepanov, who I suspect is simply too intelligent for this world. I have no idea what he's talking about half the time, but the rest is brilliant. Long story short; it's trying to solve a much bigger problem using a tool that wasn't built for it.

if stepanov would be too intelligent for this world, he would have designed proper iterators, not iterators which can run away. safe iterators are a thing, just not in the STL.

also he could have designed proper sets and usets. nobody really needs red-black trees when you have b- trees. likewise nobody needs linked-list usets, when you have open addressing or even swisstables.

you cannot copy from one container to another type. even the simpliest self-respecting libs support that.

you still have no string library, only memory buffers. many, many misdesigns in C++. just look at it, you'll get eyeblead

Some of that is limitations in the medium, he pushed C++ pretty hard outside its comfort zone implementing the STL.

Some of it is conventions of the medium, like the iterators; it's just the C++ way.

You copy (or move, there's a need for the distinction in C++) from ranges to iterators, it's just a more flexible perspective.

C++ has a string library, you may not like it but I'm pretty sure it exists.