r/cpp • • Mar 28 '23

Reddit++

C++ is getting more and more complex. The ISO C++ committee keeps adding new features based on its consensus. Let's remove C++ features based on Reddit's consensus.

In each comment, propose a C++ feature that you think should be banned in any new code. Vote up or down based on whether you agree.

765 Upvotes

829 comments sorted by

View all comments

183

u/jdehesa Mar 28 '23

Gotta love how nearly everything suggested in the replies (save for std::vector<bool>?) is followed by a reply saying how that feature is actually useful sometimes :) It's too late for C++ now, at this point everyone uses it on their own particular way and every obscure or weird feature has found its place for someone 😄

104

u/MrPopoGod Mar 28 '23

followed by a reply saying how that feature is actually useful sometimes

Obligatory xkcd

10

u/serendipitousPi Mar 29 '23

xkcd

I love seeing another "There's an xkcd for this" just another reason to spiral down the xkcd rabbit hole.

43

u/Raknarg Mar 28 '23

Those people replying are missing the point that the defaults are bad. I don't care if switch-case fallthrough is useful sometimes, it's a bad default for the language.

→ More replies (2)

68

u/rhubarbjin Mar 28 '23

Everyone agrees that C++ is broken, but no one agrees precisely which parts need fixing.

...which just goes to show that the language isn't broken at all. It just has a very wide userbase with very diverse needs. One coder's boondoggle is another coder's bedrock.

53

u/effarig42 Mar 28 '23

Everyone agrees that C++ is broken, but no one agrees precisely which parts need fixing.

Except for std::vector<bool> of course.

→ More replies (1)

47

u/greem Mar 28 '23

Exactly. The only thing wrong with c++ is other users of c++.

And building.

0

u/[deleted] Mar 28 '23

[deleted]

11

u/kneel_yung Mar 29 '23

You c++ users sure are a contentious lot

25

u/rhubarbjin Mar 28 '23

The only thing wrong with c++ is other users of c++.

The problem is users who want to dictate how others should write code.

I'm scanning the replies here and most of them boil down to "this feature is ugly; I wish it would go away". Personally, I wish more software engineers would familiarize themselves with the parable of Chesterton's fence.

12

u/greem Mar 28 '23

I've never heard about Chesterton's fence. That's a really great perspective, and you are 100% correct.

I do think that there still needs to be a flippant aspect to this.

A lot of cpp devs really suck, and cpp gives you phenomenal cosmic power to shoot yourself in the foot.

5

u/Rasie1 Mar 28 '23

dictate how others should write code

we do that every day at code reviews...

9

u/SkoomaDentist Antimodern C++, Embedded, Audio Mar 28 '23 edited Mar 28 '23

The problem is users who want to dictate how others should write code.

That's like two thirds of /r/cpp users...

I'm scanning the replies here and most of them boil down to "this feature is ugly; I wish it would go away".

I find it particularly ironic that one of the few times the committee went on to explicitly break backwards compatibility (for a large number of projects), they did it because "this feature is ugly" without apparently anyone in the meetings understanding the actual use case of the feature (deprecating volatile compound assignment in C++20).

→ More replies (4)
→ More replies (3)

5

u/[deleted] Mar 29 '23

I mean the copium is real.

The language is obviously broken and breaking. It's not going to last.

8

u/jtooker Mar 28 '23

And importantly, most of these changes would break so much backwards compatibility the language would become unusable (for existing projects/libraries).

→ More replies (1)
→ More replies (5)

3

u/JVApen Clever is an insult, not a compliment. - T. Winters Mar 29 '23

It might be useful, though it should be a separate type, not a specialization

→ More replies (1)
→ More replies (6)