C++ vs Rust: Tuples

preview_player
Показать описание
This video takes a quick look at the differences between tuples in C++ and Rust.

Chapters:
0:00 Intro
1:09 Rust
1:35 C++14
2:02 C++17
3:32 C++23
5:00 Outro

Рекомендации по теме
Комментарии
Автор

Rust is awesome, but my gosh C++ has improved so much in recent years. It trully is a new language. I'm really liking modern C++ now a days. Also funny how these languages C++ and Rust are basically becoming more Pythonic in syntax. They're basically statically typed compiled fast Python now lol.

vectoralphaSec
Автор

In the rust version, im quite certain you can put 't' in the string passed to println! directly without the extra argument, like this: println!("{t:?}");

pixelstriko
Автор

I prefer this format by far. The animations on your old one look cool, but they're distracting and I often have to rewind to check the before and after. Here with your cursor in screen, I get half a second to internalise what you're going to change first before you actually make the change, which, in my opinion, helps a lot.

qsykip
Автор

I think if you put the programming language logos to the left and right of the compiler explorer the format would be a bit better. Loved the video tho!

NilesMontblair
Автор

Honestly I prefer the old format for the videos. But I can live with this one if videos came faster.
Nice review man, I love it.

DanelonNicolas
Автор

I started getting excited about these cool features from C++20 and 23, and then some clients started complaining that my C++17 lib doesn't run on their Debian 9 machines. Rust wins on that too, the latest toolchain still supports Debian 8 without jumping through any hoops.

yondaime
Автор

That "auto main" is new to me. I would definitely use that in my new C++ program.

yvvkiRika
Автор

I like both formats - or think both have a purpose. Power Point style definitely feels higher production quality. Also, I have been interested in a video doing a comparison of different languages async or concurrent programming styles. There is a great article on this topic that is referenced called The Color of Functions. I think Rust supports Async/Await but doesn't support other concurrency models. Would appreciate a video on this if its something you are interested in!

tenthlegionstudios
Автор

Layout looks great to me. Maybe the language logos could be a bit smaller, maybe even half.

MartinClausen
Автор

No need for `return 0`; this makes the C++ code a bit more tidy.

bsdooby
Автор

This format is ok, but since it's simpler we expect now more videos, haha.

Zgl
Автор

1:53 A tuple itself is just a struct, which means there still remains a much shorter form to express a bag of fields:

struct {int a; int b;} t = {3, 4};
std::cout << t.a << ", " << t.b << '\n';

fdwr
Автор

I like the format! Just would like the logos to be much smaller imo, its a little distracting / noisy to have them take up so much screen real estate

spocot
Автор

haven’t seen any previous videos of yours, but it seems fine aside from the fact that the language logos look quite big

morshlop
Автор

I was a big fan of your presentation format. Can live with the one from this vid if it makes it easier for you!

a._s.__h_
Автор

I prefer the old format, because that is the selling point of your content, in my opinion.

jedediah-fanuel
Автор

Your review is nice as always, i must say, and thanks for telling us about new features of c++, i know rust is a nicer language but i can't handle those errors when i write code in it.

Btw, one thing that i wanted to tell u, that i don't know why people still using tuples i don't find much use cases of it, like it can act as immutable list which can/not be iterated with a for loop, or to return multiple values from a function, and likewise for something else. U know, from somewhere i got to know that tuples r actually used to store related values, then it makes more sense to use a named tuples or data classes(or record types) instead of just tuples. Im actually a big fan of Kotlin and Nim language(and according to me they r most beautiful language ever) and they provide those features, so i just use mostly that.

mohanaggarwal
Автор

very nice video!
Im waiting new video!!!

melonges
Автор

Rust is beautiful out of the box, there is a beautiful way for creating a tuple. C++ is a bloated mess at that point. The thing is, no company will move fast enough to switch to version 17 or higher. Most of the companies are still with 11 or 14. Another important thing comes when reading C++ Code. Since the companys dont change their versions fast, you will enounter the old and ugly syntax every day and you are not allowed to use the newer syntax. For me this is depressing. Therefore, the switch to Rust was absolutly a cure and highly needed to heal all the C++ pain. Hopefully C++ will get replaced forever.

ITSecNEO
Автор

"Rust clearly wins when it comes to tuples" how? You did not exactly explain anything about tuples here. If anything, Rust's standard print macro wins over the lack of a standard print function in C++ for formatting the output. You didnt show me anything that could be done in Rust that could not be done in C++ regarding the tuples themselves. If we're comparing tuples, we're comparing tuples. I was expecting to see at least some specification details, different functionality, the similarities and differences between the 2 of them, the implementation details would have been a nice extra. At the very least i was expecting to see at least an example of the usage of tuples in C++ vs Rust, but no, instead this was 5 minutes of comparing fmt::print vs println just to come to the conclusion that somehow Rust wins with the same exact output as C++. At least tell me what makes the Rust version better. Is it more performant? More elegant? What a clickbait video. I expected to learn something and i just wasted 5 mins of my life.

AlFredo-sxyy