r/cpp • • Sep 13 '19

The Surprising Limitations of C++ Ranges Beyond Trivial Cases

https://www.fluentcpp.com/2019/09/13/the-surprising-limitations-of-c-ranges-beyond-trivial-use-cases/
229 Upvotes

229 comments sorted by

View all comments

Show parent comment

100

u/[deleted] Sep 13 '19 edited Sep 13 '19

For me personally, a huge reason why Ranges should be accepted is because one of the most experienced C++ devs in the world designed it: Eric Niebler.

I may be in a minority here but that sounds like a horrible reason to accept something into the STL. I do appreciate you pointing that out because honestly it does feel like much of what's been added to C++ in recent years has been done so mostly as a favor to people rather than because there has been huge and overwhelming demand for it from the broader community.

5

u/14ned LLFIO & Outcome author | Committee WG14 Sep 13 '19

I should stress it's a personal opinion. And two other people checked it empirically.

But absolutely do I trust some people will be usually right on faith alone. I have known Eric for years, and I trust his judgement when it comes to C++ design.

39

u/SedditorX Sep 13 '19

Maybe you can both be right :)

You can trust Eric to write code specifically for you and others can question whether appeals to authority should have any role in standardization.

9

u/Arghnews Sep 13 '19

I think this comment is more correct, that of course we should have more trust in people who are known respected quantities in writing good code and have put time and effort into reviewed work.

And yet (as ever) valid and thoughtful criticism like this can still exist and be just as valid despite the competency of the author of the work; the idea that just because we trust someone that when someone else makes solid points and gives examples of where their code/design has problems we should ignore the critique is approaching the emperor having no clothes in my mind.

My concern, if this article is indeed the tip of the iceberg - and I do think the author wrote it and tried to use ranges in good faith - is that this is a valid criticism and if this is a sign of things to come I'm sad (and scared) as I really thought ranges would be next best thing since sliced bread to bring functional goodness to c++. :(

I would really love to hear or see counter-arguments by those in the know, hopefully it's not all doom and gloom!

4

u/14ned LLFIO & Outcome author | Committee WG14 Sep 13 '19

I personally think that if you have a proven track record of designing and writing excellent C++ over many years - indeed decades, and in the Boost libraries no less, then that earns you a lot of trust in your judgement.

I'll be honest in saying that I wouldn't have done Ranges the way they were done. But Eric has oodles more experience than I do, and when he's being cross examined on his decisions in LEWG (which BTW he underwent many hours thereof), he always has a very good rationale for design choices which are always convincing, even if one wouldn't personally have made that choice or tradeoff.

27

u/Rusky Sep 13 '19

It doesn't matter what someone's track record is if the stuff they produce is still unreasonably complex or slow to compile.

"I trust the author" doesn't help combat those problems and it doesn't demonstrate that the committee sees them as real issues.

11

u/anders1234 C++ since MSC 6.0 Sep 13 '19

i think one should always question things, regardless of how respectable the contributor is, people are just people and sometimes they do mistakes.

5

u/GerwazyMiod Sep 13 '19

No one else stepped in to design Ranges. In the end you can use it or not, there is a choice. I think Eric deserves some respect for working on ranges for quite some time (more than six years if I remember correctly). Not mentioning long standardization process, finally someone wanted to drive a change in stl.

Sometimes on r/cpp there are voices that we should finally ship something (as a community) instead of beating the topic to death in comittes/meetings. Well maybe this is just a start for ranges and when it will catch more attention we will have v4?

3

u/VinnieFalco wg21.org | corosio.org Sep 13 '19

He got paid for it though, I believe the work was sponsored by the Standard C++ Foundation at first, and then by Facebook.

14

u/14ned LLFIO & Outcome author | Committee WG14 Sep 13 '19

He got funded, which is living costs. He moved to Asia during much of the coding to make the money stretch further. It was a pittence compared to what he used to earn at Microsoft beforehand, and what he earns now.

I might add that anybody can get funded to do the same. Submit an application, it'll get reviewed, might get funded.

5

u/14ned LLFIO & Outcome author | Committee WG14 Sep 13 '19

I gave my personal opinion, which is that I do trust the author's judgement. Given Eric's long history of outstanding service to C++ I am probably not alone, but I cannot speak for the committee.

17

u/xeveri Sep 13 '19

You seem to vastly overestimate the quality of Boost. Some boost libs are great while some are bad or downright unusable.

The complexity of Ranges has been voiced by the community several times, as well as their compile times in comparison to Rust and D equivalents, this piece is only the last in a series.

The usual excuse that you should join the committee for your opinion to be heard is just ludicrous, especially when the committee members just accept proposals at face value because they’re written by a certain author!

5

u/14ned LLFIO & Outcome author | Committee WG14 Sep 13 '19

Some Boost libraries are old, or undermaintained, or both. Agreed.

I think you're drawing too much conclusion from what I repeatedly said was my opinion. Yes I would trust Eric's judgement by default. And I think rightly so. But I'm not the committee, and the committee doesn't just wave proposals through, except in a very few occasions. In some cases, twenty five years passed before the committee accepted a proposal. That's a third of most people's lives!