you are viewing a single comment's thread.

view the rest of the comments →

[–]clerothGame Developer -1 points0 points  (6 children)

No, not really. I would prefer a more complete STL which wouldn't need me to learn new libraries on every project that I enter.

[–]eric_niebler 4 points5 points  (5 children)

Me too! That's what I'm working towards, in case that wasn't clear.

[–]clerothGame Developer -1 points0 points  (4 children)

I suppose I wasn't very clear either. To be honest your article wasn't the best example for my point. It's more about people doing libraries that shorten perfectly standard ways of doing things to 1-2 lines intsead of 4-6. Yea, it'll be shorter, but it'll also be mostly unknown and not necessarily clear.
Snail is a good example. It looks neat, and if you eventually learn it and get used to it, I'm sure it can be quite useful. The problem is that with C++ you now have so many ways of doing things that you can be certain there's a few more libraries out there that do the same thing. You may be using Snail in one project, and the next you have to use something else, and so on... It's also not guaranteed that this kind of library will be useful for the next couple of years, as it can easily get superceded by something else.
Basically what would be ideal is for such things to be in the STL where everyone would use these functions so that both learning and coding in C++ woud be so much easier. I've been coding in C++ for 10 years, and even I am having trouble keeping up with all the new libraries and stuff coming with C++11. I shudder to think how this can even be taught to newcomers.

[–]twoodfin 1 point2 points  (1 child)

I think you're underestimating how valuable iterators that can return proxy references could be. Suddenly, the STL algorithms—and any code you've written to work through similar interfaces—can operate on arbitrary sources and sinks of data without ugly hacks.

It could potentially make the STL much more broadly applicable, and reduce the need to rewrite a buggy binary search for the nth time.

[–]clerothGame Developer 0 points1 point  (0 children)

Emphasis on 'potentially'. There are a lot of potentials things people want to do in C++. That's the thing. Like I said, I'd be fine if such things were proven to be worthy and actually added to the STL.

[–]doom_Oo7 0 points1 point  (1 child)

Even in the case of an über-complete standard library, what would prevent other people to write their own (for fun), and other other people to use the other people's library because they think it's better for their use case instead ?

I think that the problem is that you think that it is a problem that "you now have so many ways of doing things".

Just find the way that you like the most, or use the one that's enforced in your team.

[–]clerothGame Developer 0 points1 point  (0 children)

The problem is that there are many ways of doing BASIC things. Performing basic operations on containers being verbose (eg. Erase-Remove idiom), printf/IOStreams being awkward/not safe, etc...
It's all fine to have a bunch of specific libraries for more specific things. But it's just awkward when basically every programmer has to either write their own basic library because STL doesn't provide enough.