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

3

u/Dean_Roddey Jul 21 '19 edited Jul 21 '19

Of course I've been saying similar things for a long time, though it's a little ambiguous exactly what you are saying I think. I certainly believe, if this is what you mean, that way too much time has been spent on stuff like containers, much of which anyone can trivially do if when they need to, and not enough time on stuff that real applications need these days which aren't trivially doable. I also think a huge amount of time has been spent pushing premature optimization all the way up into the language design process, and trying to serve too many masters (which I think is one thing that you are clearly saying.)

I've put my money where my mouth is and created a system that puts the emphasis where I think it should be, i.e. less on creating an operating system in a single templatized header that uses zero CPU and runs at compile time, and more on providing the type of functionality that is needed to do the kinds of programs that C++ is intended for (other than embedded) without having to just throw a bunch of bits and pieces together, and maintaining readability by avoiding massive templatization, using them only where they really required.

https://github.com/DeanRoddey/CIDLib

My argument would be for a 'RISL', a Reduced Instruction Set Language, that provides the core functionality without forcing any runtime libraries at all, allowing for the development of specialized library sets for specific needs, but within the context of the same language syntax.

Not sure why I bothered typing this, because your post will get down-voted into oblivion within minutes probably and no one will ever see this.

7

u/[deleted] Jul 21 '19

like containers, much of which anyone can trivially do if when they need to

I would be very surprised to hear about a non-trivial application that doesn't use any containers. Since they are very useful, why shouldn't they be in the standard library?

I also think a huge amount of time has been spent pushing premature optimization all the way up into the language design process,

Not everyone thinks that having everything be a polymorphic class with runtime configuration for things that should be really decided at build time is a good idea.

without having to just throw a bunch of bits and pieces together

I'd rather combine multiple high-quality single purpose libraries to do the tasks that I need than having a single huuuuge monolithic library that does everything badly (or at the very least not as good as the single purpose libraries).

maintaining readability by avoiding massive templatization,

I don't know what exactly you have against templates, but they're pretty useful. Sure if you're doing a library you're probably going to need some template stuff that is a bit verbose at times but really, when you're writing code that uses them they're perfectly readable.

0

u/Dean_Roddey Jul 21 '19 edited Jul 21 '19

The fact that something is built to work as a system and shipped as such doesn't mean it's monolithic. That would require it be all in one giant library. My stuff is split up into many libraries. But they are all designed to work together from the ground up.

And it's a bit of a stretch to conclude that it's bad if it's not a standalone library. Ultimately the sum of the parts counts for a lot. When everything shares the same architectural features, the power you get from that, IMO, is a lot larger than anything you lose from the fact that every piece isn't the ultimate implementation. In fact the ultimate implementation, IMO, is sometimes not all that great because it's may be created with the problem domain in mind, not with the process of building systems in mind, and often including a lot of extra complexity that many to most applications won't need.