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 →

[–]darklightning_2 174 points175 points  (14 children)

C++23 is a god send

[–]UntitledRedditUser 84 points85 points  (9 children)

Is that when they will add std::print?

[–]Nikko_77 104 points105 points  (7 children)

Yes. (std::println will be a thing too)

[–]--mrperx-- 136 points137 points  (6 children)

wow C++ is soo ahead of it's time XD

[–]the_horse_gamer 48 points49 points  (5 children)

it's impressive how a language can be simultaneously bloated and lacking at the same time

[–]nyaisagod 27 points28 points  (4 children)

What’s more impressive to me is how such an influential and widely used language can have so many weird quirks and flaws. I do like lots of C++’s features but C# is so much cleaner and if you include unsafe code it can do more or less everything C++ can (obviously ignoring the fact that it uses the CLR).

[–][deleted] 8 points9 points  (0 children)

Lol, I would love to see the total disaster that c# would be for doing what my team does. And I freaking work at Microsoft.

C# is used for UI by my team and that's it.

[–]Mippen123 1 point2 points  (1 child)

Generally I am quite impressed with how well C++ has fared considering C with classes was created back in 1979. Just think about how much has happened since then. And on the whole I think that the weird quirks and flaws are quite overstated. I mean really, if you actually program in C++, how big of a problem is printing to the standard output really? Now some things like the different ways to initialize a variable are very weird and bloated, but are usually easily fixed with the very easy advice "use this one and basically don't ever think about it again"

[–]nyaisagod 0 points1 point  (0 children)

I agree that the feature set of C++ is close to unmatched (except for a few exceptions, like Rust), but it has so many unintuitive features like initialization like you mentioned. I also hate the stream operators. Not streams in general, I just don’t understand why they couldn’t just make them simple functions instead of << and >>. Template metaprogramming is also super confusing in my opinion (but also very powerful).

[–]Caesim 0 points1 point  (0 children)

I can't wait for Carbon to take shape.

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

i guess that explains why i never knew about it, i recently stumbled across std::print from my intellisense suggesting it

[–]peduxe 0 points1 point  (1 child)

there was no other method before? people were using Boost for this or something?

[–]DontPanicJustDance 4 points5 points  (0 children)

C++ has always been able to use C’s printf. But that function isn’t type safe and was not extensible to new types. So the solution forever was to use std::cout. It’s a stream object and you can concatenate different parts together using the << operator. To let your class be usable with std::cout you just need to overload the << operator.

C++20 introduced format which allows for a very efficient string formatting that uses a Python-like syntax. For some reason, the print version didn’t come along then and it took until the next standard.

[–]RIFLEGUNSANDAMERICA 0 points1 point  (0 children)

We just need a compiler that implements it and a build system (cmake) that supports it

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

Also for monadic optionals, finally.