r/cpp • • Jul 21 '19

C++ is broken

C++ as a language is a tool for developers to productively deliver software. Language evolution is NOT the end objective in the real world.

The whole C++ ecosystem from committee to all of the conference backslapping and training is broken in this respect. It's focus is off.

Instead of 'boost' we need 'boosted' to help define, review and encourage that wider ecosystem so developers can be productive.

It's ok to define things that aren't infinitely flexible, and infinitely extensible but get the job done.

It's OK and, in some ways better, to provide an opinionated library outside the standards rather than deliver an intellectually burdened, extensible interface two years later than needed.

All the helpful features in the core language and core libraries are MEANT to enable a much wider ecosystem to make the tool that is C++ more productive.

But we aren't getting a wider ecosystem, we are just getting a language where we are apparently 'not paying for' a huge intellectual burden.

I want to say at this point that intellectually I am constantly impressed by the committee's work and standards BUT ...

The payoff just isn't happening. Even within the standards committee more time is being spent in intellectually stimulating but largely pointless activities because the tool and productivity benefits aren't happening.

Look at how the wider productive ecosystem hasn't flourished since C++ 11.

I know many excellent libraries have been made, but think about your next large project and how much is coming from a mixed bag of variable quality 3rd party libs to plug basic capabilities.

The committee work is spread so thin that core building blocks get pushed out further in time and so can't be built upon by library authors.

Networking, executors, any form of I/O - slipping again.

Lots of hard work being done but by far too few people in their spare time.

Seems a very dysfunctional way to move the monolith forward.

'You don't pay for what you don't use' is laudable up to a point, but the 'don't use' because you don't actually have, say, a basic network library is more of a reality.

That basic network lib and executor model I've been impatiently waiting for should probably not be part of the core standards remit (architectural concepts and keyword support for executors would probably be necessary, but not much else.)

If we had the metaclass generation as proposed, I'd hope even more of these items would then be able to fall outside the standards.

9 Upvotes

147 comments sorted by

View all comments

47

u/blelbach NVIDIA | ISO C++ Library Evolution Chair Jul 21 '19

So, I'm not really sure I understand your point, or what you think should be improved.

Can you give me a TL;DR/bullet points on what you think?

14

u/JuanAG Jul 21 '19

Do you mind if i give my opinion?

In short, a smooth experience like the one you get with Python, Node or similar

No build system, make it a default one that hides all the complexity of the project but that allows some customization, Visual Studio ones is far from perfect but it would be a good starting point

A good package manager, including a third party lib is painfull and slow and chances of success are not 100%

A better and more complete STL with simplier sintax, list.find() or list.contains() instead of "std::list<int>::iterator findIter = std::find(ilist.begin(), ilist.end(), ObjectToFind);" which will require a post process in the findIter object, i know the C++ is more versatile but it makes harder and complex to use

That´s would be a nice starting point and if the ISO promises it will be coming to the language in recent years (26?) i will wait for it because i am at the point of switching, in the next months i am going to buy a good book about Rust and give a real try, if i like what i see i will make the switch, i was reading the reddit about it and there are jobs offer (here are too but in the sense that is not a toy, is a useful tool that companys are using) or the fact that they are working on an ultra fast compiler only for debuging make me smile like i havent since C++ 11 release, and it is only one feature

23

u/blelbach NVIDIA | ISO C++ Library Evolution Chair Jul 21 '19

No build system, make it a default one that hides all the complexity of the project

See, this is the problem with zero-config build systems; you can't just "hide" the complexity in the general purpose case. Can you make something that works for many simple use cases? Sure. But you can't make something that works that way for everyone's large scale C++ projects.

C++ targets a different later in the stack than Python or Node. You use it to solve different problems. You use C++ to build fundamental and system software layers. Sometimes, by nature, that is complex.

8

u/kalmoc Jul 21 '19

I don't think the main problem is that c++ is used for different kind of projects (although that is a problem). The main problem is that there hasn't been any standard build system, project layout, dependency management system, c++ featuresey or in general "standard way to do things" for the last 2-3 decades. But any modern solution (package management or build system) is expected to make interop with all the projects that have been developed in all that time to "just magically work".

7

u/blelbach NVIDIA | ISO C++ Library Evolution Chair Jul 21 '19

There is no standard build system or project layout that will work for everyone.

3

u/degski Jul 21 '19 edited Jul 21 '19

Iff there were to be a iso-std-layout, that would hugely improve the chances of coming up with [or converging to] a std-build-system and/or for existing tools to 'just magically' work [also] on that std-layout.

3

u/blelbach NVIDIA | ISO C++ Library Evolution Chair Jul 21 '19

SG15 voted on this at this meeting. We had consensus against recommending a particular project layout.

1

u/tcris Jul 23 '19

why?

1

u/blelbach NVIDIA | ISO C++ Library Evolution Chair Jul 23 '19

We don't think there's one answer that works for everyone.

1

u/tcris Jul 27 '19 edited Jul 27 '19

java has maven which uses a default layout in 99.99% of cases. They still support non-std layouts via parameters. Something similar can't be done for c++? (nothing ever fits everyone, that's sure and that's not the point)

Yes, I know it's not java, but maven supports other languages as well, generated code, folders for tests, resources, whatnot. It's not impossible to adapt something like that.