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.
@JGHFunRun
Жыл бұрын
I expect in the next 10 years we'll be able to use : ... instead of {...} in both languages
@PeterAuto1
Жыл бұрын
@@JGHFunRun it will be difficult to get rid of all {} in rust, because you are allowed to create a block in the middle of code in order to create a new scope and blocks are also expressions. so you can have things like this let x = 5; { let x = 3; } or let x = { let x = 3; x } but I would support a change where you can use : + indent as alternative to {}
@flyingsquirrel3271
Жыл бұрын
Yes, they are adding more and more of "modern" features to C++, but all the terrible old stuff has to stay in the language, making it even larger and leading to even more different subsets of the language being used in different codebases throughout the ecosystem and industry. Also the tooling is a complete mess and different on every platform, every company, etc.. A lot of this just can't really be fixed for historic and backwards-comlatibility related reasons, so I really think its just time to move on to Rust. C++ had its time, but for most applications, should be replaced now or at least not be used for new projects (That seems to already be common practice in the industry at the moment). Rust learned a lot from its success and its mistakes and is able to replace it perfectly in most domains. Even the carbon projects suggests you use Rust for new projects and Carbon only for additions to existing, large C++ code bases.
@yondaime500
Жыл бұрын
@@PeterAuto1 Why though? Why would Rust copy one of the worst ideas Python ever came up with? Giving syntactic meaning to invisible characters, smh.
@JGHFunRun
Жыл бұрын
@@PeterAuto1 well I did say “able to”, considering the way Rust and C++ deal with backwards compatibility neither would ever remove the support for {…}. I would also complain about it if they fully removed it, but I think that : as an option would be cool
@qsykip
Жыл бұрын
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.
@NilesMontblair
Жыл бұрын
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!
@avidrucker
Жыл бұрын
This calls for a design-off! Haha
@DanelonNicolas
Жыл бұрын
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.
@tenthlegionstudios1343
Жыл бұрын
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!
@MiiaoTheFC
Жыл бұрын
std::thread after “rust doesn’t support concurrency”: *disappears*
@tenthlegionstudios1343
Жыл бұрын
@@MiiaoTheFC I am still deeply interested in this topic. I listen to a talk by Kprotty (dev who is working on concurrency and IO in zig) and he mentioned there are some misconception about colorless functions. He talks about the concurrency/IO iceberg, and places GO and Rust Tokio in the same iceberg level. Apparently tokio uses some of Gos concurrency model. Anyways, just interested in learning more about this! CSP for instance is what GO is based on and that involves Type theory. But I havent seen someone I trust do an in depth breakdown of this.
@MartinClausen
Жыл бұрын
Layout looks great to me. Maybe the language logos could be a bit smaller, maybe even half.
@TranscendentBen
Жыл бұрын
I didn't want to make a "main" comment out of this, but who decided computer programming languages should have logos? It seems this started in the last decade or two, and the older and no-longer-popular languages don't seem to have them.
@avidrucker
Жыл бұрын
Interesting question this, I agree. Marketing is part of the industry, it seems.
@Z1g0l
Жыл бұрын
This format is ok, but since it's simpler we expect now more videos, haha.
@bsdooby
Жыл бұрын
No need for `return 0`; this makes the C++ code a bit more tidy.
@budiardjo6610
Жыл бұрын
love this format
@fdwr
Жыл бұрын
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
@joaovictorfernandes1656
Жыл бұрын
I like this video format
@a._s.__h_
Жыл бұрын
I was a big fan of your presentation format. Can live with the one from this vid if it makes it easier for you!
@notreallyokay9355
Жыл бұрын
haven’t seen any previous videos of yours, but it seems fine aside from the fact that the language logos look quite big
@mohanaggarwal4058
Жыл бұрын
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.
@diadetediotedio6918
Жыл бұрын
Tuples are usefull for returning multiple values, and even Kotlin has them (and a shorthand for the syntax to, you can write "x to y" and it will convert in the tuple). But comparing all of them I find C# tuples to be the best, because you can fakely name their values, so instead of: fn abc() -> (X, Y) let res = abc(); println!("{}", res.0); One could simple write in C#: (x: X, y: Y) abc() var res = abc(); Console.WriteLine($"{res.x}"); Their names are compile time only, but it works like a charm
@yogthemuskrat
Жыл бұрын
In C++ tuples are used heavily in templated code.
@flowname
Жыл бұрын
Because tuples are the simplest type for every bifunctor-based API.
@ITSecNEO
7 ай бұрын
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.
@AlFredo-sx2yy
Жыл бұрын
"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.
@xphreakyphilx
Жыл бұрын
He was just saying they're much easier to use in Rust, given that they're a first class language feature
@AlFredo-sx2yy
Жыл бұрын
@@xphreakyphilx cool, but that still doesnt teach me anything. The title implies im going to see a comparison between the two and i only saw a comparison between formatted print functions. I didnt get what i was promissed.
@AlFredo-sx2yy
Жыл бұрын
@Watcher uh... thanks for recommending me the thing everyone who is learning Rust is already doing, i guess. Thats not the point of my comment tho.
@pmcgee003
Жыл бұрын
He said first in a series ... that's a lot of typing for a first video ... 🤨🙂
@AlFredo-sx2yy
Жыл бұрын
@@pmcgee003 doesnt matter, the video still didnt deliver what it promissed, did it? I was promissed A vs B, i got C vs D instead.
@cepi24
Жыл бұрын
Please make new vids from this series
@NithinJune
5 ай бұрын
can you make the logos smaller?
@melonges7884
Жыл бұрын
very nice video! Im waiting new video!!!
@444limm
Жыл бұрын
I love both languages
@MrYevelnad
10 ай бұрын
Can c++ do something like these? let (x,y) = (2,3)
@laifsyn5347
5 ай бұрын
I once wrote something as this if let (flavour, true) = (&self.neg_flavour, num.is_negative()) { self.flavourize_with_negative(&mut words, *flavour) } Personally it saves me from a somewhat ugly (ugly to me because the input parameters are overcrowded) if num.is_negative(){ self.flavourize_with_negative(&mut words, &self.neg_flavour) }
@TheBuilder
Жыл бұрын
Rust wins again, how can C++ even compete?
@martingeorgiev999
Жыл бұрын
agree. Least unhinged cpp syntax: std::get::std::tuple::()::for_each::std::get()
@tuanva6484
Жыл бұрын
So scared of tuples in java 🤣
@decky1990
Жыл бұрын
These Rust cult videos are a bit mental. I’ve rarely had the need for a tuple. I’d be better off using a struct, or perhaps a union if I was trying to save space
@blindshellvideos
Жыл бұрын
java is good language
@DanelonNicolas
Жыл бұрын
hahahaahahahahahahahaa
@ABDTalk1
Жыл бұрын
❤️❤️❤️
@MiiaoTheFC
Жыл бұрын
Even worse than C++…
@blindshellvideos
Жыл бұрын
rust is bad language
@nac5605
Жыл бұрын
😦
@mohanaggarwal4058
Жыл бұрын
Learn Rust and then start talking about it.
@jwadaow
Жыл бұрын
@@mohanaggarwal4058 why learn a bad language?
@blindshellvideos
Жыл бұрын
@@mohanaggarwal4058 i dont need to use rust to know its a bad language.
@MiiaoTheFC
Жыл бұрын
Your opinion is very important, but not really needed.
@pixelstriko1642
Жыл бұрын
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:?}");
@MiiaoTheFC
Жыл бұрын
True!
@martingeorgiev999
Жыл бұрын
println!("{:?}", (1, 2));
@yvvkiRika
Жыл бұрын
That "auto main" is new to me. I would definitely use that in my new C++ program.
@MiiaoTheFC
Жыл бұрын
It’s been around since C++11 I guess
@Martiriak
Жыл бұрын
It's the C++ way of doing trailing return types, note that the int is still there, just at the end of the signature.
@yondaime500
Жыл бұрын
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.
@flowname
Жыл бұрын
How's that supposed to make any sense? If their Debian 9 can support Rust toolchain, why wouldn't the same distro support C++17 toolchain if that toolchain get brought into the distro the same way the Rust one got in?
@spocot
Жыл бұрын
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
@jedediah-fanuel
Жыл бұрын
I prefer the old format, because that is the selling point of your content, in my opinion.
@nixielee
Жыл бұрын
Old format. Live writing and speculating is not great
@monorail0
Жыл бұрын
I'd love to see more of these!
@dmitriidemenev5258
Жыл бұрын
I beg to disagree with your claim that Rust's tuples are better! I'm a Rust developer and I love Rust but tuples are its weak point! Or rather, lack of support for variadic generics! It's a very important feature that Rust is missing. It doesn't allow implementing a trait for tuples of arbitrary length and this is a big deal. Let's say we have a tuple t of type (A,B,C,D) and A, B, C, D implement common interface (~trait) Quack. One very reasonable thing that we might want to do it to use quack() on t.0, t.1, t.2, t.3 However, that's impossible. We don't even have a way to find out what the length of tuple is! I had a discussion in Rust internals about it and the `adhoc` keyword. But I haven't implemented it because I can't.
@MiiaoTheFC
Жыл бұрын
One of Rust’s key features is unambiguity, and now you call it a drawback. I must disagree with you.
@dmitriidemenev5258
Жыл бұрын
@@MiiaoTheFC Can you clarify how variadic generics can hurt unambiguity?
@MiiaoTheFC
Жыл бұрын
@@dmitriidemenev5258 I’m talking not about variadic generics, but about automatic application of a trait to types of all values of the tuple. Rust’s generics are superior to templates though.
@dmitriidemenev5258
Жыл бұрын
@@MiiaoTheFC I meant there must be an opt-in way to apply Quack trait on a tuple whose types all implement Quack. I recognize that this particular behavior can be undesirable but I can see that it can have many positive applications
@MiiaoTheFC
Жыл бұрын
@@dmitriidemenev5258 having all these ideas implemented, such as tuple iteration, “would be nice”. I’m pretty happy we don’t though.
Пікірлер: 91