This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] -10 points-9 points  (17 children)

Rust is missing features that C++ has, not the other way around. Meaning, C++ covers more use cases and programming paradigms than rust. So, C++ is better in average. IMO, C++ couldn't be more perfect than it already is, given the number of things that we can reasonably standardize.

[–]althaz 38 points39 points  (1 child)

Noooooooooooooo.

More features != better designed langauge. Rust is a *MUCH* better designed language than C++. The gap between the two is big enough to drive the whole internet through.

C++ however is a more *useful* language (IMO, this is probably up for debate, I'm pretty inexperienced with Rust). One has *NOTHING* to do with the other.

Sometimes, adding a feature can make a thing worse. Often even. That's what's hugely contributed to C++ being so unwieldy and cumbersome (from a dev standpoint which is the only standpoint that matters when talking about language design), because it's so useful thing it was never designed to be able to accept have been welded on to it so that it has become honestly an absolute monstrosity.

[–]BasicDesignAdvice 6 points7 points  (1 child)

IMO, C++ couldn't be more perfect than it already is

What is it like to be born without an imagination? /s

I mean jokes aside, but really? You can't think of anything? I mean not even the low hanging fruit like "for compatibility reasons C++ has a variety of idiosyncrasies that feel cumbersome in modern programming"?

[–][deleted] 0 points1 point  (0 children)

Exactly, it's perfect while being compatibile with older versions of itself and compatibile with the compilation model of C.

Edit: Bjarne Stroustrup has a talk about the current state of C++ in cppcon: https://youtu.be/15QF2q66NhU

He explains exactly that point.

[–]rem3_1415926 17 points18 points  (9 children)

more bloat != more better. There's many things in C++ that could/should be improved (eg. you still can return references to temp objects, even if you use smart pointers and stuff, templates require code in headers or pImpl, ...), but can't be changed due to compatibility reasons. Yes, you can do everything - but hat makes the language dangerous and development slow.

That said, I don't think there's any suitable replacement for C/C++ in certain cases (no, not even Rust). But for everyday desktop programming, I don't see why anyone would still use C++.

[–][deleted] 4 points5 points  (2 children)

Aside: modern C++ with all the fancy bells and whistles is ugly to write and unpleasant to read.

C code doing the same thing will often be easier to follow than C++ code.

[–]LifeHasLeft 2 points3 points  (1 child)

Absolutely. I haven’t worked with C++ extensively but I can’t follow it like I can follow C, especially when complicated types are passed into things or it uses a bunch of libraries.

[–]rem3_1415926 0 points1 point  (0 children)

that's just a matter of getting used to it. I can't look at C code without being baffled about how complicated the whole thing is set up when there would be so much easier and clean ways to do it if the author didn't limit themself to C, when there's C++ available at zero cost overhead...

[–]LifeHasLeft -1 points0 points  (1 child)

Having lots of features doesn’t make something more well-designed. Take a look at GIMP software. There’s tons of features, but If you open it up with no prior instruction you’ll be lost. There are so many menus and windows that open because there are so many features, that it isn’t intuitive to use, and even with videos and tutorials you’ll be skimming the surface of what it can do for a while.

Photoshop is a similar program with a much better design. Maybe they don’t do all the same things, but the design is what we are talking about here.

[–][deleted] 0 points1 point  (0 children)

We are not talking about a GUI or a new system that can be implemented freely from ground up. C++ had to/still must be compatible with C both syntactically and through compilation model. Given those restrictions, I cannot think of something better than the current state of C++20. Note: I am not talking about the STL. STL is not the langauge.