C++ is not an OOP language. Its a multi-paradigm language which lets you develop Object oriented systems. You can mix and match various paradigms to solve your problem as it seems fit. It doesn't force you to follow a certain methodology. For example : in OOP languages like Smalltalk and Java, everything is an Object which certainly not the case with C++.
I’m mostly with you, however the standards committee is trying. Newer versions of C++ are introducing much more convenient functional-programming style features. See std::ranges and improved lambda support with the auto keyword. They can’t change older versions of C++ or remove features, so adding new features is all they can do, and they’re doing it
@@kasufert No, just use auto with appropriate invocable concept and you're all set. For E.g. : void process(std::invocable auto func) { .... } the process function takes an invocable that accepts a string_view and returns an int.
@@aniketbisht2823 C# only requires Func or Action for a function variable, or x => f(x) for a lambda. I’m not saying C++ doesn’t have those features but the syntax is quite cumbersome.
@@kasufert That's just the standard version. You can also define your own concepts which are much more specialized and compact (less verbose). C++ lambda expressions are only slightly more verbose than C# because more things need to be accounted for like captures, template parameters, attributes etc. If you want one-liner lambda expressions, a widely used library to do that is Boost.Lambda2.
In c++, it is hard to shot yourself in the foot, but when you do you can blow your leg off. In rust, it is impossible to shot yourself in the foot, because you are forced to remove both of your legs.
@@MakeitFast9052 it is total nonsense. The thing that lets us shoot into the foot is in a different place. If we ever need it we can use it but most of the time it is not needed.
Respect for improving the video after constructive feedback from your viewers. This sadly isn't a matter of cause anymore on TH-cam. I think it's an amazing video now. Greetings from Germany❤
C and C++ will never be replaced, in the past 30 years so many languages have risen and fallen, but C (especially) and C++ have really stood the test of time
The Ottoman Empire will never be replaced, in the past 500 years so many countries have risen and fallen, but the Ottomans have really stood the test of time
I think C/C++ will be replaced when all of the children of people here watching this video die of old age or AI takes over all the programmers's jobs. But, seriously, Cobol is still being used widely.
Of all the points, I cannot agree that C++ is a better option for larger scale applications. When there are multiple people working on a project, it's so hard to keep track of reference lifetimes or multithreaded safety, and that's where Rust absolutely shines - it will hold your hand and tell you that your code is unsafe without digging into other people's code.
The main reason why learning c++ is still the better option in my opinnion is that everyting serious is written in it, so you have infinite resources to learn software development straight from the source. For example, amd’s fsr3 is open source and written in c++, want to know how it works? Helps a lot if you know c++
@@skyline00069 yeah, with the full meaning of the word ”serious”. Here are some places where C++ is the language of choise: operating systems (even though c is still used in the kernel), game engines, games (unity is the only platform place where language other than C++ builds AAA games), cars, aviation, space, ai, robotics, audio, databases, etc etc etc. Rust can do these things but C++ is still the ”industry standard” in real world and performance critical applications, so basically in everything else than webdev and enterprise code aka java. So i think that can be summarized as ”basically everything serious is written in c++”, you don’t see cars driving around with rust running in the drive computer.
@@aboliguu1168 Why do you think that is? Rust is a newer language, and it only recently started getting backed by mozilla, while C++ is a really old language that most companies have been using for years, even decades on end that wouldn't benefit from switching to Rust.
Thats way better ! You've improved a lot the quality of the video compared to the old one ! You took reasonable arguments from boths sides and it seems alltogether way less biased. Bravo !
I love how you remade the video. Btw, I was in your drunk VC, but I was troublehsooting an issue with my mic, so I couldn't talk. Edit: Remember when you were making something, and it wouldn't work, so you had to make a new project and start over? The problem was with your 'debug' script, it was attempting to run "/src/index.js" but you didn't have an src folder.
Learning C++ in 2024 is like learning Latin. You need to know it to work on existing projects and get a job. Learning Rust is for starting new generation of applications. Rust is objectively better than C++ in my opinion even though people say they have less freedom because of oppressing borrow checker. My counter argument to that is that it is just a strict mentor who forbids "bad" practices. I become a better programmer in the last 2 years of using Rust than I would have become in 20 years of not using it. It also makes collaboration more practical as you don't need to decipher your colleagues code, because it's "relatively" the same due to the rules. I see only benefits here.
"would have become" , not became. People, who didn't learn the rules of grammar, cannot be trusted to pay attention to details when coding. That is my, empirically based, experience.
I found that learning Rust improved my code and make a flatter hierachy, more straight forward memory usage ect. Most business people don't care about the details of the language, they will just use C++ or Javascript because the ecosystems allow a lot of people to do it.
Just use whatever you want, I don't think it ever had any point on this discussions. Obviously it does not mean the discussions in are pointless, in fact it is pretty needed because security in software development, but for most people this does not matter most of the time. You should engage in these discussions when you are actually planning on making something that can affect peoples lives if it fails, and discuss why it is not more justified to use a language that is built to be safe instead of one associated with unsafety. People have good points on both sides, like static analyzers and the dont's of static analyzers, but the discussion does not make sense if you are making a game or a simple software, chill and make it wether in Rust or C++ or really anything at all.
Amethyst is long dead, bevy holds the torch (and fyrox ofc, though its community is way small compared to bevy even though codebases are in similar size). There are lots of small frameworks or engine agnostic libraries that one can use for their own framework.
Bjarne Stroustrup's sacred word has already been written, many false prophets have already tried to kill his message, and many will still try, but C++ resists! (This is just a joke guys, but yes, C++ is still better option).
IMO C++ is the one big exception to this golden rule because it was deliberately not designed to be specific to anything. Rather the opposite, it's a jack of all trades and a master of nothing so for virtually every specific task there's a better tool. C++'s luck was that it came early and that many projects are not very specific to begin with. LOL
Problem with Rust for writing low level code is that, not only you have to jump through several hoops to do what you want (get desired assembly with zero extra overhead) but the resulting code is very unreadable and also difficult to change. Readability and the ability to quickly change/iterate through multiple implementation strategies (with their own trade-offs) is crucial for writing performant low-level code. The language also enforce various runtime checks (which cannot be disabled at runtime like C++ asserts), so even if you strive hard to write correct code by using formal methods, testing it religiously etc, you would still be paying for them at the runtime or your code would be littered with unsafe blocks (which defeats the whole purpose while also making you code less readable).
You do not understand unsafe in Rust. Unsafe does not defeat the purpose of rust’s memory safety. All of Rust’s smart pointers use unsafe under the hood. The idea of unsafe is to write code where you handle “unsafe” operations and wrap it in a safe way so that when you call the function or block, the user can use it safely. By itself, you can’t do memory unsafe things with Box or RefCell or Rc because the “unsafeness” was abstracted away. Also readability is subjective and a function of experience. If you code a lot in a language, idiomatic solutions are very readable to you in that language.
@@irrelevantgaymer6195 I never said unsafe Rust defeat the purpose of Rust's memory safety. In fact, that's the whole point I am making, unsafe Rust is tedious. If you want performance you have to write low-level code catered to your specific needs and then wrap it in nice zero-cost abstractions for application programmers to use and make it generic without giving up functionality or performance. Both C++ and Rust have good feature for providing abstractions (C++ even more so). But when it comes to writing low-level code, in Rust you have to jump through several hoops which makes it tedious to write whereas in case of C++ it's just C which is just simple as it gets. When you are solving a hard low level problem, things should be as hard as they fundamentally hard not more. Rust gets in your way (even while writing unsafe Rust) and makes it harder and more complex than it needs to be.
On discovering Rust and evaluating it for up and coming projects I rewrote quite a few of my not so big C/C++ projects and libs into Rust. Performance turned out to be similar, sometimes slower sometimes faster. No, I did not use "unsafe" anywhere. As for those run time checks. There is only array bounds checks as far as I know. Oh and arithmetic overflow checks in debug builds. Often they are optimised away by virtue of the compiler having more information about what your code does. Often they are a vanishingly small part of execution time. Either way they seem to have negligible effect on performance. I have lots of number crunching code that operates on arrays to demo that. So no, there is no problem with Rust for writing low level code. You are only speculating that having not tried it or measured it.
@@irrelevantgaymer6195the “unsafe” keyword in Rust is terribly misnamed. It doesn’t mean the code is unsafe, it means you declare to the compiler that you have manually checked the block’s safety.
@@eypandabear7483 I don’t think it’s misnamed, but it is a bad name. I think the name itself leads people to use unsafe when it’s the best solution to the problem.
Currently Rust would be best choice for servers where you cant/dont want to use gc lang else C++ specially For game dev C++ is the overlord for highend graphics
@@kphuts815 both are good but c++ is standard for game dev industry and theres 2 rust game engine bevy and frox they are not as popular as other engine so i would say c++ is the safe choice
@@kphuts815 Because the of the large code base written in C++ (and in CUDA C++ if you're using Nvidia), otherwise you have to be a very good developer if you want to use Rust.
It's a very good summary for all languages. Rust is way more better in my case because it's more easy to setup and deploy, that things in c++ is a nightmare.
I had this exact mindset for quite a while, however, since I'm mainly coming from object oriented languages like Java and C#, I always felt like C's type system was lacking some things. Mind you, I'm not one of those people who think OOP is the solution to everything and bloat their program with an excessive amount of classes for things that don't really need them. I like the simplicity that C's type system has, but for me personally, I think it's just missing some things. I was hoping that C++ would solve that problem for me, but the moment I tried to make a simple C struct and C++ literally prevented me from doing very basic things with it that are possible in C, I dropped the language immediately and went back to C. Then I decided to give Rust a shot, and imo it's a perfect middle ground. Its type system allows for very simple things in the way C does (if you just want a small, basic struct that you want to be able to copy around, just give it the Copy trait and the borrow checker will leave you alone, SOMETHING THAT EVEN C++ WAS NOT CAPABLE OF FOR ME), but also has more advanced features like Traits (which are similar to interfaces). Tagged unions are also a built-in feature (kinda misleadingly named "enums", though they CAN be used as regular enums as well) which is really powerful.
@@remboldt03ffs Java is relatively memory safe and have garbage collector and can be fast...still most people hate Java...I like to be able to do whatever I want and that's why I prefer C and Perl do it your way...not right way...and let be honest Rust makes it difficult to write unsafe code but not impossible..if u are dumb language doesn't help
2:11 It is explained in Rust docs, it is nature of reference counted smart pointers, especially in connection with pointers designed to be out of borrow-checker control by design (RefCell) , it is well explained how to avoid this or use Weak if you need cycles. This only not freeing memory, technicaly it is leak (leaving less memory) but it could only lead to DoS. This example is unfair, because it causes stack overflow but it happens because println! macro don't handle cycles of this kinds well and loops. And many languages with such power (.toJSON ) have the same problem, because it is not simple or costless to avoid it.
1:38 this is not particularly strange or unique to Rust. Swift and Objective-C have Automatic Reference Counting which similarly deallocates when the last reference is dropped.
The problem with C++ is people who say they know it, dont know it enough to write a code faster than Rust, even though language itself allows it. C++ is gonna be the next Assembly
Rust is not developer friendly. It is a nightmare to learn and use. I've learned and used dozens of languages over the past 40 years, and rust is by far the most difficult I've encountered. It's way more difficult than C++, and the syntax sucks. I've just completed a small benchmark based on the prime sieve... C++ vs rust. Both using the same approach. Results: execution time for primes to 10,000,000,000 (code optimised for speed. CPU i7 12700) MSVC C++: 27 sec (MFC GUI App) Clang/LLVM C++: 30 sec (MFC GUI App) MSVC C: 25 sec (terminal) Rust: 29 sec (terminal) The C++ implementation is a few hours work. Converting to rust, about 2 days' work. And for all of the MS bashing, MSVC came out on top, though not by much. This was just a fun exercise. I wouldn't read much into these figures, but I did expect rust to outperform.
I had no problem learning Rust at 17 with about one year and three months of experience with JS and PHP. I had way less experience and only in dynamically typed languages. And I had barely any issues. It's my go to language for everything now, even scripting. So this is definitely not Rust's issue.
If I'm working alone, maybe I'd prefer C++ if I was more experienced with it. But working in a team? Rust hands down. No matter how talented the people you work with are, eventually someone will screw up, and the amount they screw up is only limited by the tools they use. In C++, your ability to stumble into a catastrophic design flaw is substantially higher than in Rust. The worst case scenario in Rust is a slow piece of code, or something that refuses to compile. I'll take that over an accidental Heartbleed any day of the week. It's not the 90's anymore, your little video transcoding library that doesn't need to be memory safe is now a pivotal piece of software running every video website on Earth. The consequences of insecure code are so much greater than they ever were. Honestly no different than speed limits. Sure, *you* might think you're able to drive faster than the limit safely, and emergency vehicles get to be an exception, but that doesn't change the fact that speeding kills.
Something I will always hold over every other language is that both the Linux kernel and Tor have adopted Rust Both are projects that have to be perfect because if they aren't then people die Until Linux adopts a third language and/or ditches Rust, I'm gonna be a smug bitch about it
Which language to learn? Both, if you have the time. They are really not that different. Once I rewrote quite a complicated project from Rust to C++ in 4 days. Which language to use? Depends on the use case, and what coding style you're most comfortable with. You glossed other linking and library management, also cross-platform development. Rust makes it trivial to develop for (and on) several platforms with nearly no extra effort. I write something on Linux for days, and then it just compiles on my Windows machine no problem.
With modern C++ you also have pretty much safe code but it isn't enforced by the compiler. C++ only lacks an extended standard library which is its biggest drawback compared to other environments (e.g. Java; C#).
I only add that other powers of Rust are: macros [sane] - super power to skip so much boilerplate without compiler behind scene magic , strong and robust type system which let you shield not only from memory errors but some logical errors by next programmers which have to work with your code ;)
4:45 “a lot of people enjoy this approach”, referring to “doing more work to link packages correctly”. Is this a serious argument that I’m not getting. Is there some example of a benefit? I do get that for someone who knows that approach it is just a part of life, but would you recommend that to someone picking up programming tomorrow?
Different use cases. Very cool project and I hope it ends up being used everywhere, but I wouldn't use it everywhere I use Rust (or C++ for that matter)
Every language is worth learning if it really is the best choice for a project, even if only for learning different ways code can be written. If you already know languages that allow you to get work done, I suggest spending time mastering those instead of learning another you might never use. I would also advise you to ask about Zig to Zig experts, not Rust ones haha.
@@ok-alarm I was told before learning Rust that "if you know Rust, you don't really have a reason to use Go" by a friend who learned and used Go for years before learning Rust, so I'm not entirely convinced
@@HoloTheDrunk well thats really up to, on my case, I also know rust first but there are few jobs open for rust than Go, so I learned Go for my full time job then rust for my personal projects and building up my portfolio for future rust jobs.
WYM, that's a perfectly legible linker error. Your function or whatever with the long-ass name in the ViewController file tried to access a variable or function declared extern within ViewController but not defined by any files provided to the linker. Or, to put it another way, that long-ass name wants some shit the linker don't know where's at.
Since computers them selves think in ECS form, hence why ECS is faster than OOP. Then why not design a language around the system's native form even if it's not as human friendly?
c++ while annoying is rewarding and challenging. Other languages, well.... is easy >= aneurysm? but also c++ is probably the most flexible language there is.
Nah, not exactly. They are closer to type classes than to interfaces, at least if you consider interfaces as they where originally designed in Java/C#.
Rust Traits are way more powerful. You can impl a trait for a external type, you can impl a trait for a generic, you can add specific constraints for a impl, you can have associated constants, you can have associated types, you can have generics in associated types, you can have constraints in associated types. If I would pick an example, it would be Haskell's classes, though I'm not sure if it has all Traits' features (you can have HKT in Traits, but it's syntax is kind of weird and there is not std Trait for that)
normally i’d it’s impossible to “kill” a language, but it really does seem like the Rust community is hellbent on killing C++. I’ve tried learning C++ three times (i’m still a novice) and the first two times i just got an instant headache, even after learning Java.
First of all, thanks for improving the video. It's still misleading in many ways though. > C++ is object oriented C++ is multiparadigm. > Rust uses trait system which is unique to the language It's not unique to the language. E.g. Haskell type classes are similar to traits. > Rust effective at preventing memory leaks I don't see how Rust helps against memory leaks how C++ doesn't. > .clone overuse C++ is no different > C++ is also known for great backwards compatibility Rust is the same with editions. > Rust has good interop with C C++ is the same. It's true that Rust can't easily interop with C++, which is a good point.
My personal opinion (as a C# dev who looked at Rust, Go and C++): it seems to be much easier to write cross platform programs with Rust and Go. C++ has Boost, which helps a lot, but I had to compile it statically before linking to my statically build hello world program. The result was pretty good, but I had a Boost directory containing 10gb of data just to accomplish a simple task in a cross platform manner (create process lol). In Go and Rust this is much easier and quicker. Anyways... I'm not very experienced with C++, last time I seriously worked with it is 20 years ago. But the tooling seems a lot harder. Sure, I could do it without Boost, but then I'd have to write my C++ code for each OS separately with preprocessor if statements. PS I'm using Go now 😅 It gets out of my way and is fast enough. My main goal was to use something that's more efficient than C# (in size, memory usage and startup time).
And here we are some months later and the US government is trying to push initiatives to phase out C/C++ in favor of Rust and garbage collected languages 😆 Some of what I saw entailed possibly fining specific areas of the industry for not adopting memory safety. Companies that write software for critical infrastructure and the like.
Any resources for me to learn rust? I've been youtubing but the ones i found are a million hours long (i don't have that time unfortunately and i need to make a compiler and i really want to use it and not C) with... a HUGE LOT of info, talk about spending more than 7 minutes explaining what data types are on a PowerPoint presentation instead of teaching how things work on the surface and leave me to search on my own (which i find more productive to me)
Can't wait for cpp match expressions and typed enums. When they are implemented, I'll probably stop using Rust altogether.. There are even some ongoing work in a cpp borrow-checker. Also, using cpp for historically object-oriented implementations are considered old-school and pure interfaces ( Rust Traits) are used instead. There are some caveats that you must know in cpp, which isn't ever any problem in Rust, though. cpp23 and cpp26 really isn't the same language as cpp11 (or cpp98), which seems to be the version must Rust devs using when they bash cpp. This is a problem in itself - there are too many ways of doing the same thing in cpp. To keep up, you really need to make an effort every new release (Professional cpp Linux and embedded systems developer, dipping his toes into Rust - though I prefer using go wherever i use Rust right now)
In my opinion c++ should improve on error detected with g++ and gcc complier and c++ should include most optimise code in c++23 such math_23 something like that
@@yehaa00 c++? system management drivers, bare metal hypervisors. deobfuscation tools with the triton framework, like dissemblers for virtual machine obfuscated malware. A small game with Unreal engine. All of those things are C c++ heavy, and there's no benefit in using in rust because of how strict it is. Sometimes I need to access memory I'm not sure is safe, but thats okay because I also wrote the interrupt descriptor table to specifically handle any issues. Writing these same things in rust provides no benefit because I either have to spam the Unsafe keyword in which case I might as well just be using c++, or rust just doesn't allow me to do what I want to do without basically having a wrapper over a library thats already written in C. Example is UEFI, which is industry standard. Sure, I could write a UEFI driver in rust, but holy shit that sounds miserable for the little benefit I get. Rust's problem is that it doesn't solve any issues that C++ doesn't already have solutions for. It doesn't do anything special that you couldn't do in C++. It's trying to be the middle man in between compiled and interpreted languages by doing like 70% of what makes those languages good. W
C++ you should use C++. Rust is not actually easier and its actually slightly less performant and the compile times take a very long time and the size of the exe or what ever it is, is just huge every single time
@@RustIsWinning ah yes the classic rust vs cpp as much as i like to debate they both work well if i am being honest but where is the fun in getting along when we can continue to ridicule each other so here mine goes *clears throat* "CPP has successfully created many apps OS kernels etc... there is pretty much nothing cpp cant do and personally i find cpp much more intuitive then rust although i do confess rust has actually good error messages and my cpp code is more performant then my rust code and just as secure and reliable"
Honestly my take is that C++ is harder to learn because you really can't learn all of it cause it's way to bloated, there's so many keywords, special syntax, std libraries, and just ways to write things like if you ask 20 random Rust and C devs how to solve a problem you're probably gonna get 20 of the same answer or similar answers but if you ask 20 random C++ devs how to solve a problem you're gonna get 20 different answers with what type names they use, what naming conventions they use, how heavily are they using the std lib, etc and each one will probably tell you their way is the best way and ur stupid for doing anything differently. I have been using C++ for almost 3 years now (only 6 months professionally) and Im pretty shocked by how often I discover new syntax I never knew was valid or just how many ways there is to solve problems and while on one hand it's cool it's also just frustrating on the other because even though I feel like I should objectively understand the language I find reading other peoples code pretty difficult due to style conflicts and how we just fundamentally write the code differently. For instance I'm not the biggest fan of the bajillion C++ features so I tend to just write C then use C++ features where I think they're useful (namespaces, structs with methods, smart pointers to name a few) so when I read other peoples more "modern" C++ where I see nested ternary operator one liners with tons of std lib calls, not a single raw pointer in site, and just some of the most ugly code I have ever seen, I really just don't get it nor get why people would want to write that. I think Rust is insanely easier to learn than C++ and it's not even close. I think the entry to start writing working programs C++ takes the cake because not only does rust make you learn all the same low level concepts you also have to worry about the ownership and borrowing system on top of that which makes it so when u first start writing Rust it will be hard to just do anything correctly. I think this is why I see such an overuse of .clone(), owned types, and unsafe rust in rust newbies because they don't understand the borrow checker so they just try to sidestep it to get their code to run. Once you get past the borrow checker though you pretty much have learned 80% of rust all that's left is to understand unsafe land, async, and macros (somewhat optional) then you pretty much have mastered the language whereas there is no mastering C++, you will have been writing C++ for 3 decades then learn of brand new syntax out of the blue or find some other persons C++ code unreadable. Yeah I agree with the performance stuff I tend to find C++ to be slightly faster, sometimes rust is faster and I don't know why it's faster because the assembly (even in release mode or C opt level 3) is completely unreadable which is probably why so many people write malware with it nowadays. I don't have enough C++ experience on big projects but from what I have heard when there's a lot of templates going on the C++ and rustc compile times are pretty similar otherwise yeah the rust ones are gonna be slower, but I also think it's not really fair to just say that's a 100% negative thing. The rust compiler is doing a lotttttt more then the C++ compiler. Yeah the C++ one is gonna be faster and save me how many milliseconds or few seconds everytime I compile but how much time do rust error messages and the borrow checker save me compared to figuring out whatever vague linker error, error, or skill issue is going on when I use C++? Sure if I have 0 issues I will have maybe saved a few seconds or minutes not having to wait for the rust compiler compared to the faster C++ compiler but the moment a issue comes up that the rust compiler catches and the C++ one doesn't then I kinda think the C++ one wastes more of my time, that's just my take tho if that makes sense.
I suggest you spend a decade working in C and C++. Or even assembly language. Then you will understand what memory safety is all about and which you had not wasted a decade of your life.
@mikedesanta4612, @toparamennoodles9652 What you are describing is "memory leak", which is a memory bug, but less impactful in sense of "safety". Memory leaks can cause OS to shut your program or cause DDOS attacks, using your server's resources; but that's the limit of damage they can do. On the other hand, there are other memory related bugs that have much serious issues. Like accessing a donkey expecting a whale, trying to get 21. donkey out of 20 donkeys, trying to ride a donkey that is already being riden or trying to ride non-existent donkey. These are dangerous because they can corrupt data, or worst, cause remote code execution.
The only realistic benefits to pull developers to rust was supposedly faster build time. In fact, c++ build time is said to be generally faster, which is already strike out. If c++ 20’s module system works out and unfolds greatly, I think theres no hope for rust in future. As theres no reason to move.
I can't imagine where you heard this. People have been complaining about build time in Rust since long before 1.0. Grandpa? Is that you? Did you smoke one of those funny cigarettes again? :)
Rust is the future of programming languages for low-level applications. And it could also have a say in other areas such as the Web, for example in conjunction with WebAssembly.
Security is a field for which you need years of experience. There are no languages one can learn to easily be proficient. It would be C and probably some bash though.
C++ is not an OOP language. Its a multi-paradigm language which lets you develop Object oriented systems. You can mix and match various paradigms to solve your problem as it seems fit. It doesn't force you to follow a certain methodology. For example : in OOP languages like Smalltalk and Java, everything is an Object which certainly not the case with C++.
If the C++ committee wanted us to do FP they wouldnt have made us type out S-T-D-Colon-Colon-Function every time we want to pass a function.
I’m mostly with you, however the standards committee is trying. Newer versions of C++ are introducing much more convenient functional-programming style features. See std::ranges and improved lambda support with the auto keyword.
They can’t change older versions of C++ or remove features, so adding new features is all they can do, and they’re doing it
@@kasufert No, just use auto with appropriate invocable concept and you're all set. For E.g. : void process(std::invocable auto func) { .... }
the process function takes an invocable that accepts a string_view and returns an int.
@@aniketbisht2823 C# only requires Func or Action for a function variable, or x => f(x) for a lambda. I’m not saying C++ doesn’t have those features but the syntax is quite cumbersome.
@@kasufert That's just the standard version. You can also define your own concepts which are much more specialized and compact (less verbose). C++ lambda expressions are only slightly more verbose than C# because more things need to be accounted for like captures, template parameters, attributes etc. If you want one-liner lambda expressions, a widely used library to do that is Boost.Lambda2.
In c++, it is hard to shot yourself in the foot, but when you do you can blow your leg off.
In rust, it is impossible to shot yourself in the foot, because you are forced to remove both of your legs.
Lmfao, good analogy. Rust is just slept on because he can't let developers write shit code.
@RustIsWinning where is rust now? Noone uses rust for anything real.
This is...
Accurate.
@@MakeitFast9052 it is total nonsense. The thing that lets us shoot into the foot is in a different place. If we ever need it we can use it but most of the time it is not needed.
@@mikeyangyang8816 tell me you dont know rust without telling me you dont know rust:
Respect for improving the video after constructive feedback from your viewers. This sadly isn't a matter of cause anymore on TH-cam. I think it's an amazing video now.
Greetings from Germany❤
C and C++ will never be replaced, in the past 30 years so many languages have risen and fallen, but C (especially) and C++ have really stood the test of time
C++ will lose to Tha Rust Propaganda
Other languages simply didn't offer what C and C++ did in terms of low level control. Rust does and does it better.
The Ottoman Empire will never be replaced, in the past 500 years so many countries have risen and fallen, but the Ottomans have really stood the test of time
I think C/C++ will be replaced when all of the children of people here watching this video die of old age or AI takes over all the programmers's jobs. But, seriously, Cobol is still being used widely.
@@kasufertChina, Egypt (and others I cannot remember) have been along for thousands of years, while other countries have risen and fallen.
6:45 clearly this was a secret coded message to tell us to use Go
LOL 😂
Of all the points, I cannot agree that C++ is a better option for larger scale applications. When there are multiple people working on a project, it's so hard to keep track of reference lifetimes or multithreaded safety, and that's where Rust absolutely shines - it will hold your hand and tell you that your code is unsafe without digging into other people's code.
Agree
Yeah, I was thinking the same thing when I heard that part.
The main reason why learning c++ is still the better option in my opinnion is that everyting serious is written in it, so you have infinite resources to learn software development straight from the source. For example, amd’s fsr3 is open source and written in c++, want to know how it works? Helps a lot if you know c++
"Serious"? Same thing goes for rust, although I agree with your point about the "infinite resources"
@@skyline00069 yeah, with the full meaning of the word ”serious”. Here are some places where C++ is the language of choise: operating systems (even though c is still used in the kernel), game engines, games (unity is the only platform place where language other than C++ builds AAA games), cars, aviation, space, ai, robotics, audio, databases, etc etc etc. Rust can do these things but C++ is still the ”industry standard” in real world and performance critical applications, so basically in everything else than webdev and enterprise code aka java.
So i think that can be summarized as ”basically everything serious is written in c++”, you don’t see cars driving around with rust running in the drive computer.
@@aboliguu1168 Why do you think that is? Rust is a newer language, and it only recently started getting backed by mozilla, while C++ is a really old language that most companies have been using for years, even decades on end that wouldn't benefit from switching to Rust.
@@aboliguu1168 not yet, hihi
Spot on! I also agree with you on this. It'd be better for a beginner to thorougly learn C++ first and switch to Rust afterwards.
Thats way better ! You've improved a lot the quality of the video compared to the old one ! You took reasonable arguments from boths sides and it seems alltogether way less biased.
Bravo !
4:19 The java virtual machine sometimes it's kinda wild lmao.
Actually it is really fast, in most cases even faster than code in c++ because the c++ developer has no clue what he is doing 😂🤣
I love how you remade the video. Btw, I was in your drunk VC, but I was troublehsooting an issue with my mic, so I couldn't talk.
Edit: Remember when you were making something, and it wouldn't work, so you had to make a new project and start over? The problem was with your 'debug' script, it was attempting to run "/src/index.js" but you didn't have an src folder.
Yeah I was way too drunk to be socialising or programming 😂
Lockheed Martins F-35 runs on and uses C++
There are hundreds of thousands of jobs within C++
I love C++ because I know it contributes to more deaths annually than natural disasters
God, I hope all memory is static.
Boeing too uses C++, thought yo let you know what is memory unsafe beings is like
Weird for that because I know for certain that the most important pieces of software are written using Ada because of it's safety.
@@matthewb192 Absolutely, I think you are right about ADA. And tts often used together with/complementing C++ ...
C++ Countless features. You got me there
Nice! The video truly is much better after the remake, thanks for owning up to your mistakes and handeling critisism so well :)
Learning C++ in 2024 is like learning Latin. You need to know it to work on existing projects and get a job. Learning Rust is for starting new generation of applications. Rust is objectively better than C++ in my opinion even though people say they have less freedom because of oppressing borrow checker. My counter argument to that is that it is just a strict mentor who forbids "bad" practices. I become a better programmer in the last 2 years of using Rust than I would have become in 20 years of not using it. It also makes collaboration more practical as you don't need to decipher your colleagues code, because it's "relatively" the same due to the rules. I see only benefits here.
agree with most point but "objectively better in my opinion" is just not it
But but but it’s slower 😢
"would have become" , not became.
People, who didn't learn the rules of grammar, cannot be trusted to pay attention to details when coding.
That is my, empirically based, experience.
@@DumbledoreMcCrackenok, says, the, guy, who, uses, , everywhere,
@@RustIsWinning exactly, you've proven my point to a T.
My expectation is that you were "educated" in Alabama.
If you want to be a true backend developer, master both languages, C++ (especially latest standard) and Rust.
Too many language just choose one
@@RustIsWinning doesn't necessarily many but whatever the job demands isn't?
@@RustIsWinningbeginner mentality. skilled developer knows how to write safe code in any language.
I found that learning Rust improved my code and make a flatter hierachy, more straight forward memory usage ect. Most business people don't care about the details of the language, they will just use C++ or Javascript because the ecosystems allow a lot of people to do it.
"In fact jesus himself used c++ whitch is probably the reason why he was crus-" that really got me 💀
You could say that he...
...nailed it.
@@yarpen26 bro...
Bro that literally made me spit out water
Lame
That was wild as a Christian 💀
Just use whatever you want, I don't think it ever had any point on this discussions.
Obviously it does not mean the discussions in are pointless, in fact it is pretty needed because security in software development, but for most people this does not matter most of the time. You should engage in these discussions when you are actually planning on making something that can affect peoples lives if it fails, and discuss why it is not more justified to use a language that is built to be safe instead of one associated with unsafety. People have good points on both sides, like static analyzers and the dont's of static analyzers, but the discussion does not make sense if you are making a game or a simple software, chill and make it wether in Rust or C++ or really anything at all.
Amethyst is long dead, bevy holds the torch (and fyrox ofc, though its community is way small compared to bevy even though codebases are in similar size). There are lots of small frameworks or engine agnostic libraries that one can use for their own framework.
Bjarne Stroustrup's sacred word has already been written, many false prophets have already tried to kill his message, and many will still try, but C++ resists!
(This is just a joke guys, but yes, C++ is still better option).
There are no "better" tools, there are trade-offs. Some tools are better in some jobs than others.
@@kulkalkul I agree.Use rust where it makes sense and use c++ where it makes sense.Same for any other language.
IMO C++ is the one big exception to this golden rule because it was deliberately not designed to be specific to anything. Rather the opposite, it's a jack of all trades and a master of nothing so for virtually every specific task there's a better tool. C++'s luck was that it came early and that many projects are not very specific to begin with. LOL
@@RustIsWinningkid wakeup.
@@RustIsWinning you did what?
I’ll be using both as well as C.
Problem with Rust for writing low level code is that, not only you have to jump through several hoops to do what you want (get desired assembly with zero extra overhead) but the resulting code is very unreadable and also difficult to change. Readability and the ability to quickly change/iterate through multiple implementation strategies (with their own trade-offs) is crucial for writing performant low-level code. The language also enforce various runtime checks (which cannot be disabled at runtime like C++ asserts), so even if you strive hard to write correct code by using formal methods, testing it religiously etc, you would still be paying for them at the runtime or your code would be littered with unsafe blocks (which defeats the whole purpose while also making you code less readable).
You do not understand unsafe in Rust. Unsafe does not defeat the purpose of rust’s memory safety. All of Rust’s smart pointers use unsafe under the hood. The idea of unsafe is to write code where you handle “unsafe” operations and wrap it in a safe way so that when you call the function or block, the user can use it safely. By itself, you can’t do memory unsafe things with Box or RefCell or Rc because the “unsafeness” was abstracted away.
Also readability is subjective and a function of experience. If you code a lot in a language, idiomatic solutions are very readable to you in that language.
@@irrelevantgaymer6195 I never said unsafe Rust defeat the purpose of Rust's memory safety. In fact, that's the whole point I am making, unsafe Rust is tedious. If you want performance you have to write low-level code catered to your specific needs and then wrap it in nice zero-cost abstractions for application programmers to use and make it generic without giving up functionality or performance. Both C++ and Rust have good feature for providing abstractions (C++ even more so). But when it comes to writing low-level code, in Rust you have to jump through several hoops which makes it tedious to write whereas in case of C++ it's just C which is just simple as it gets. When you are solving a hard low level problem, things should be as hard as they fundamentally hard not more. Rust gets in your way (even while writing unsafe Rust) and makes it harder and more complex than it needs to be.
On discovering Rust and evaluating it for up and coming projects I rewrote quite a few of my not so big C/C++ projects and libs into Rust. Performance turned out to be similar, sometimes slower sometimes faster. No, I did not use "unsafe" anywhere.
As for those run time checks. There is only array bounds checks as far as I know. Oh and arithmetic overflow checks in debug builds. Often they are optimised away by virtue of the compiler having more information about what your code does. Often they are a vanishingly small part of execution time. Either way they seem to have negligible effect on performance. I have lots of number crunching code that operates on arrays to demo that.
So no, there is no problem with Rust for writing low level code. You are only speculating that having not tried it or measured it.
@@irrelevantgaymer6195the “unsafe” keyword in Rust is terribly misnamed. It doesn’t mean the code is unsafe, it means you declare to the compiler that you have manually checked the block’s safety.
@@eypandabear7483 I don’t think it’s misnamed, but it is a bad name. I think the name itself leads people to use unsafe when it’s the best solution to the problem.
This video got uploaded just when I needed it
Thank you for getting it right this time. I respect that.
Currently Rust would be best choice for servers where you cant/dont want to use gc lang else C++ specially For game dev C++ is the overlord for highend graphics
Why is c++ so good for high end graphics? I'm looking into making an engine in my free time and I'm trying to decide between c++ or rust
@@kphuts815 both are good but c++ is standard for game dev industry and theres 2 rust game engine bevy and frox they are not as popular as other engine so i would say c++ is the safe choice
@@kphuts815 Because the of the large code base written in C++ (and in CUDA C++ if you're using Nvidia), otherwise you have to be a very good developer if you want to use Rust.
It's a very good summary for all languages. Rust is way more better in my case because it's more easy to setup and deploy, that things in c++ is a nightmare.
C++ team:
Forget C++ or Rust just learn C.
If you know c++... You can easily learn c
forget C learn assembly
@@sankalppatidar4975 Assembly? Real programmers use pure binary
@@sankalppatidar4975 forget all language and back to the stone age
I had this exact mindset for quite a while, however, since I'm mainly coming from object oriented languages like Java and C#, I always felt like C's type system was lacking some things. Mind you, I'm not one of those people who think OOP is the solution to everything and bloat their program with an excessive amount of classes for things that don't really need them. I like the simplicity that C's type system has, but for me personally, I think it's just missing some things.
I was hoping that C++ would solve that problem for me, but the moment I tried to make a simple C struct and C++ literally prevented me from doing very basic things with it that are possible in C, I dropped the language immediately and went back to C.
Then I decided to give Rust a shot, and imo it's a perfect middle ground. Its type system allows for very simple things in the way C does (if you just want a small, basic struct that you want to be able to copy around, just give it the Copy trait and the borrow checker will leave you alone, SOMETHING THAT EVEN C++ WAS NOT CAPABLE OF FOR ME), but also has more advanced features like Traits (which are similar to interfaces). Tagged unions are also a built-in feature (kinda misleadingly named "enums", though they CAN be used as regular enums as well) which is really powerful.
"Control over memory" for me only means "freedom to write more bugs"
real
tbf if you don't need control over memory there's not much reason to use c++ or rust
@@personator I don't need full control over memory. That's why I prefer Rust over C. Rust is memory safe without relying on a garbage collector
@@remboldt03ffs Java is relatively memory safe and have garbage collector and can be fast...still most people hate Java...I like to be able to do whatever I want and that's why I prefer C and Perl do it your way...not right way...and let be honest Rust makes it difficult to write unsafe code but not impossible..if u are dumb language doesn't help
0:24 well it's **nearly** a superset
i think its lovely of you to acknowledge that c++, a language thats been used excessively for 40 years, is "fully capable" :')
i already watched this didnt i
Me too...
same :|
pretty sure this is a reupload, not sure why tho
Yeah, its a re-visit with improved points
The Jesus frame got removed
2:11 It is explained in Rust docs, it is nature of reference counted smart pointers, especially in connection with pointers designed to be out of borrow-checker control by design (RefCell)
, it is well explained how to avoid this or use Weak if you need cycles.
This only not freeing memory, technicaly it is leak (leaving less memory) but it could only lead to DoS.
This example is unfair, because it causes stack overflow but it happens because println! macro don't handle cycles of this kinds well and loops.
And many languages with such power (.toJSON ) have the same problem, because it is not simple or costless to avoid it.
6:38, to me, if I have flexibility, I have everything! (theoretically)
0:18 Didn't jesus use holy C?
Yes, after he turned Assembly into C, in order to feed the masses.
I thought Jesus wrote in COBOL.
Jesus use TempleOS
For more clarifications please, Rust was announced 2010 and got stabled 2015
1:38 this is not particularly strange or unique to Rust. Swift and Objective-C have Automatic Reference Counting which similarly deallocates when the last reference is dropped.
The problem with C++ is people who say they know it, dont know it enough to write a code faster than Rust, even though language itself allows it.
C++ is gonna be the next Assembly
Rust is not developer friendly. It is a nightmare to learn and use. I've learned and used dozens of languages over the past 40 years, and rust is by far the most difficult I've encountered. It's way more difficult than C++, and the syntax sucks.
I've just completed a small benchmark based on the prime sieve... C++ vs rust. Both using the same approach.
Results: execution time for primes to 10,000,000,000 (code optimised for speed. CPU i7 12700)
MSVC C++: 27 sec (MFC GUI App)
Clang/LLVM C++: 30 sec (MFC GUI App)
MSVC C: 25 sec (terminal)
Rust: 29 sec (terminal)
The C++ implementation is a few hours work. Converting to rust, about 2 days' work. And for all of the MS bashing, MSVC came out on top, though not by much. This was just a fun exercise. I wouldn't read much into these figures, but I did expect rust to outperform.
Holy 40 years!! Maybe it's time to retire? Dont worry. We non-boomers are improving the world 😊
Rust is for long run and efficient performance, not the speed.
did you use the --release tag? because if you didn't the compiler lets a lot of optimization out
I had no problem learning Rust at 17 with about one year and three months of experience with JS and PHP. I had way less experience and only in dynamically typed languages. And I had barely any issues. It's my go to language for everything now, even scripting. So this is definitely not Rust's issue.
If I'm working alone, maybe I'd prefer C++ if I was more experienced with it. But working in a team? Rust hands down. No matter how talented the people you work with are, eventually someone will screw up, and the amount they screw up is only limited by the tools they use.
In C++, your ability to stumble into a catastrophic design flaw is substantially higher than in Rust. The worst case scenario in Rust is a slow piece of code, or something that refuses to compile. I'll take that over an accidental Heartbleed any day of the week.
It's not the 90's anymore, your little video transcoding library that doesn't need to be memory safe is now a pivotal piece of software running every video website on Earth. The consequences of insecure code are so much greater than they ever were. Honestly no different than speed limits. Sure, *you* might think you're able to drive faster than the limit safely, and emergency vehicles get to be an exception, but that doesn't change the fact that speeding kills.
0:16 jesus actually used holyc
Something I will always hold over every other language is that both the Linux kernel and Tor have adopted Rust
Both are projects that have to be perfect because if they aren't then people die
Until Linux adopts a third language and/or ditches Rust, I'm gonna be a smug bitch about it
Which language to learn? Both, if you have the time. They are really not that different. Once I rewrote quite a complicated project from Rust to C++ in 4 days.
Which language to use? Depends on the use case, and what coding style you're most comfortable with.
You glossed other linking and library management, also cross-platform development. Rust makes it trivial to develop for (and on) several platforms with nearly no extra effort. I write something on Linux for days, and then it just compiles on my Windows machine no problem.
The build systems and dependency management is something that I hate with C++. Rust just makes it so easy.
With modern C++ you also have pretty much safe code but it isn't enforced by the compiler. C++ only lacks an extended standard library which is its biggest drawback compared to other environments (e.g. Java; C#).
The syntax alone of Rust is insanely horrible, if you just want general purpose, just go with C. It's simple, plain and efficient.
It can be a funny video to try the QUICK protocol. I don’t have a idea what project you can do. But I think it’s interesting
c++ is legend!!
I only add that other powers of Rust are: macros [sane] - super power to skip so much boilerplate without compiler behind scene magic ,
strong and robust type system which let you shield not only from memory errors but some logical errors by next programmers which have to work with your code ;)
any video courses you can recommend for c++? for beginners?
there's tons, just type C++ tutorial for beginners on youtube and you'll find a 10 hr long tutorial
Rust is superior, but just a note C++ is not a superset of c for a long time...
rust is very much not superior
What is superior than rust for you?
this script is 98% chat gpt generated, specially the c gives fine-grained access part
y not just do what nim did? (but without indentation cuz screw that) make high level code compile to c++, and add option to write c++ for control. 🤔
Your video inspired me to write a blog on the topic, thanks a lot, great job.
I think of it as C++ reborn as Rust. It's reincarnation! Just like Java -> Kotlin. 👻
I want to believe the Rust hype but it is not easy.
4:45 “a lot of people enjoy this approach”, referring to “doing more work to link packages correctly”.
Is this a serious argument that I’m not getting. Is there some example of a benefit?
I do get that for someone who knows that approach it is just a part of life, but would you recommend that to someone picking up programming tomorrow?
0:41 TRAITS ARE NOT UNIQUE TO RUST
Anyway, continue
Rust has a distinctly high-end-ish feel to it, while at the same time producing very safe and very fast binaries. What's not to like?
traits are not unique to rust im upset and angry >:(
4:09 hard truths with humor 🤣🤣
Zig is better than both of them.
And even while still not even being 1.0
What Zig has that Rust doesn't have? I know Zig has a cool macro system...
@@crimsonmeguminZig has no macros and is focusing more on replacing C.
@@ciso Sorry, I used the wrong term. "Comptime expression evaluation"
Different use cases. Very cool project and I hope it ends up being used everywhere, but I wouldn't use it everywhere I use Rust (or C++ for that matter)
@@crimsonmegumin No problem :)
Short answer: C++
Long answer: Rust
I'm still a student but I want to work in robotics and AI, which one would you recommend me ?
C++ and python
@@damolaomoniyi5145 Ok thanks
"unless you are looking for a job"... Stop bullying us man ☹️
What are your thougts on Zig, is it worth learning?
imo, learn it, then you would know if its really worth it..
but if you're choosing what to learn first, I'd say:
C ➡ C++ ➡ Rust ➡ Go ➡ Zig
Every language is worth learning if it really is the best choice for a project, even if only for learning different ways code can be written. If you already know languages that allow you to get work done, I suggest spending time mastering those instead of learning another you might never use. I would also advise you to ask about Zig to Zig experts, not Rust ones haha.
@@ok-alarm I was told before learning Rust that "if you know Rust, you don't really have a reason to use Go" by a friend who learned and used Go for years before learning Rust, so I'm not entirely convinced
@@HoloTheDrunk well thats really up to, on my case, I also know rust first but there are few jobs open for rust than Go, so I learned Go for my full time job then rust for my personal projects and building up my portfolio for future rust jobs.
@@HoloTheDrunk I don't know much Go. If you know Rust, what benefits does Go have?
my problem with rust is i feel like im being force fed good food. ik its for my own good, i just don’t like it.
WYM, that's a perfectly legible linker error. Your function or whatever with the long-ass name in the ViewController file tried to access a variable or function declared extern within ViewController but not defined by any files provided to the linker.
Or, to put it another way, that long-ass name wants some shit the linker don't know where's at.
C is basically Eminem/50cent of Programming world, many new gen try cancel them, but fail
Traits are unique to the language - not really. Haskell and Scala have them too, probably others as well
Since computers them selves think in ECS form, hence why ECS is faster than OOP.
Then why not design a language around the system's native form even if it's not as human friendly?
do it yourself if you want thing's get done, sadly im not that good at CS to start such a project, good point
c++ while annoying is rewarding and challenging. Other languages, well.... is easy >= aneurysm?
but also c++ is probably the most flexible language there is.
@@RustIsWinning but that's part of the fun!
@@RustIsWinningmore like a skill issue, cope neo rust liberal
@@mazazaza11 Found the EdgelordZoomer LOL
@@RustIsWinning said by the mossad funded bot
Good video! Thanks! 😊
c++ is good and rust is also good and i like both but i like c++ slightly more because i am more familiar with it
6:29 would had been funny if you ended there
after hours of editing it was very tempting 😂
Tbh traits are not entirely unique to rust. They are pretty much interfaces from java/c#/go with fancy typing on top
Technically speaking, you can create interfaces in C++ too with virtual abstract member functions.
Nah, not exactly. They are closer to type classes than to interfaces, at least if you consider interfaces as they where originally designed in Java/C#.
even php has traits
Rust Traits are way more powerful. You can impl a trait for a external type, you can impl a trait for a generic, you can add specific constraints for a impl, you can have associated constants, you can have associated types, you can have generics in associated types, you can have constraints in associated types. If I would pick an example, it would be Haskell's classes, though I'm not sure if it has all Traits' features (you can have HKT in Traits, but it's syntax is kind of weird and there is not std Trait for that)
hmm what if i learn both what should i do first ?
You can learn both at the same time. They are pretty similar imo
@@Инструктор-д1г sir yes sir
C++, Rust coding intuitions don't carry over well to classic programming languages (e.g. C/C++, python, Java)
normally i’d it’s impossible to “kill” a language, but it really does seem like the Rust community is hellbent on killing C++. I’ve tried learning C++ three times (i’m still a novice) and the first two times i just got an instant headache, even after learning Java.
Damn lol, what gave you the headache?
First of all, thanks for improving the video. It's still misleading in many ways though.
> C++ is object oriented
C++ is multiparadigm.
> Rust uses trait system which is unique to the language
It's not unique to the language. E.g. Haskell type classes are similar to traits.
> Rust effective at preventing memory leaks
I don't see how Rust helps against memory leaks how C++ doesn't.
> .clone overuse
C++ is no different
> C++ is also known for great backwards compatibility
Rust is the same with editions.
> Rust has good interop with C
C++ is the same. It's true that Rust can't easily interop with C++, which is a good point.
I developing an ClamAV community project on C/C++ instead of Rust.
Rust would be good together with Vulkan, both overly complicated
didnt this video come out like 2 weeks ago
3:11 Yes it is now Option type in C++ but not have such power ;)
Gigachads use C++
@@RustIsWinning You are just a patty for Krabsburger
My personal opinion (as a C# dev who looked at Rust, Go and C++): it seems to be much easier to write cross platform programs with Rust and Go.
C++ has Boost, which helps a lot, but I had to compile it statically before linking to my statically build hello world program. The result was pretty good, but I had a Boost directory containing 10gb of data just to accomplish a simple task in a cross platform manner (create process lol).
In Go and Rust this is much easier and quicker.
Anyways... I'm not very experienced with C++, last time I seriously worked with it is 20 years ago. But the tooling seems a lot harder.
Sure, I could do it without Boost, but then I'd have to write my C++ code for each OS separately with preprocessor if statements.
PS I'm using Go now 😅 It gets out of my way and is fast enough. My main goal was to use something that's more efficient than C# (in size, memory usage and startup time).
And here we are some months later and the US government is trying to push initiatives to phase out C/C++ in favor of Rust and garbage collected languages 😆
Some of what I saw entailed possibly fining specific areas of the industry for not adopting memory safety. Companies that write software for critical infrastructure and the like.
traits are not unique to rust; they also exist in Haskell... Haskell works exactly the same way as rust.
Pistachio flew in to spread misinformation
Any resources for me to learn rust? I've been youtubing but the ones i found are a million hours long (i don't have that time unfortunately and i need to make a compiler and i really want to use it and not C) with... a HUGE LOT of info, talk about spending more than 7 minutes explaining what data types are on a PowerPoint presentation instead of teaching how things work on the surface and leave me to search on my own (which i find more productive to me)
the book is the best resource (search "rust the book")
Can't wait for cpp match expressions and typed enums. When they are implemented, I'll probably stop using Rust altogether.. There are even some ongoing work in a cpp borrow-checker. Also, using cpp for historically object-oriented implementations are considered old-school and pure interfaces ( Rust Traits) are used instead. There are some caveats that you must know in cpp, which isn't ever any problem in Rust, though. cpp23 and cpp26 really isn't the same language as cpp11 (or cpp98), which seems to be the version must Rust devs using when they bash cpp. This is a problem in itself - there are too many ways of doing the same thing in cpp. To keep up, you really need to make an effort every new release
(Professional cpp Linux and embedded systems developer, dipping his toes into Rust - though I prefer using go wherever i use Rust right now)
"once c++ copies the essence of rust, i will move to c++" great point c++tard
Damn this guy is clueless deluxe 😂
In my opinion c++ should improve on error detected with g++ and gcc complier and c++ should include most optimise code in c++23 such math_23 something like that
C++ is absolute freedom and most can't handle freedom. Rust is ultimate protection, a childproof language for, well, children.
Mention what things you've built with either language
@@yehaa00 c++? system management drivers, bare metal hypervisors. deobfuscation tools with the triton framework, like dissemblers for virtual machine obfuscated malware. A small game with Unreal engine.
All of those things are C c++ heavy, and there's no benefit in using in rust because of how strict it is. Sometimes I need to access memory I'm not sure is safe, but thats okay because I also wrote the interrupt descriptor table to specifically handle any issues. Writing these same things in rust provides no benefit because I either have to spam the Unsafe keyword in which case I might as well just be using c++, or rust just doesn't allow me to do what I want to do without basically having a wrapper over a library thats already written in C. Example is UEFI, which is industry standard. Sure, I could write a UEFI driver in rust, but holy shit that sounds miserable for the little benefit I get.
Rust's problem is that it doesn't solve any issues that C++ doesn't already have solutions for. It doesn't do anything special that you couldn't do in C++. It's trying to be the middle man in between compiled and interpreted languages by doing like 70% of what makes those languages good. W
ah yes the coding children. youre wayyy too pissy about this. its just a language calm down
@@RustIsWinningit's time to grow sincerely without propaganda.
@@RustIsWinning spam bot: get it over grandpa. get it over boomer. rust is winning. C/C++ devs.
C++ you should use C++. Rust is not actually easier and its actually slightly less performant and the compile times take a very long time and the size of the exe or what ever it is, is just huge every single time
Big skill issue, more performant, compiles as slow as C++ and you never heard of release mode + compiler flags LOL 😂😂😂
@@RustIsWinning ah yes the classic rust vs cpp as much as i like to debate they both work well if i am being honest but where is the fun in getting along when we can continue to ridicule each other so here mine goes *clears throat* "CPP has successfully created many apps OS kernels etc... there is pretty much nothing cpp cant do and personally i find cpp much more intuitive then rust although i do confess rust has actually good error messages and my cpp code is more performant then my rust code and just as secure and reliable"
Honestly my take is that C++ is harder to learn because you really can't learn all of it cause it's way to bloated, there's so many keywords, special syntax, std libraries, and just ways to write things like if you ask 20 random Rust and C devs how to solve a problem you're probably gonna get 20 of the same answer or similar answers but if you ask 20 random C++ devs how to solve a problem you're gonna get 20 different answers with what type names they use, what naming conventions they use, how heavily are they using the std lib, etc and each one will probably tell you their way is the best way and ur stupid for doing anything differently.
I have been using C++ for almost 3 years now (only 6 months professionally) and Im pretty shocked by how often I discover new syntax I never knew was valid or just how many ways there is to solve problems and while on one hand it's cool it's also just frustrating on the other because even though I feel like I should objectively understand the language I find reading other peoples code pretty difficult due to style conflicts and how we just fundamentally write the code differently. For instance I'm not the biggest fan of the bajillion C++ features so I tend to just write C then use C++ features where I think they're useful (namespaces, structs with methods, smart pointers to name a few) so when I read other peoples more "modern" C++ where I see nested ternary operator one liners with tons of std lib calls, not a single raw pointer in site, and just some of the most ugly code I have ever seen, I really just don't get it nor get why people would want to write that.
I think Rust is insanely easier to learn than C++ and it's not even close. I think the entry to start writing working programs C++ takes the cake because not only does rust make you learn all the same low level concepts you also have to worry about the ownership and borrowing system on top of that which makes it so when u first start writing Rust it will be hard to just do anything correctly. I think this is why I see such an overuse of .clone(), owned types, and unsafe rust in rust newbies because they don't understand the borrow checker so they just try to sidestep it to get their code to run. Once you get past the borrow checker though you pretty much have learned 80% of rust all that's left is to understand unsafe land, async, and macros (somewhat optional) then you pretty much have mastered the language whereas there is no mastering C++, you will have been writing C++ for 3 decades then learn of brand new syntax out of the blue or find some other persons C++ code unreadable.
Yeah I agree with the performance stuff I tend to find C++ to be slightly faster, sometimes rust is faster and I don't know why it's faster because the assembly (even in release mode or C opt level 3) is completely unreadable which is probably why so many people write malware with it nowadays.
I don't have enough C++ experience on big projects but from what I have heard when there's a lot of templates going on the C++ and rustc compile times are pretty similar otherwise yeah the rust ones are gonna be slower, but I also think it's not really fair to just say that's a 100% negative thing. The rust compiler is doing a lotttttt more then the C++ compiler. Yeah the C++ one is gonna be faster and save me how many milliseconds or few seconds everytime I compile but how much time do rust error messages and the borrow checker save me compared to figuring out whatever vague linker error, error, or skill issue is going on when I use C++? Sure if I have 0 issues I will have maybe saved a few seconds or minutes not having to wait for the rust compiler compared to the faster C++ compiler but the moment a issue comes up that the rust compiler catches and the C++ one doesn't then I kinda think the C++ one wastes more of my time, that's just my take tho if that makes sense.
Rust is better in evey way, except inheritance and dynamic linking
composition >>> inheritance anyway
I'm new to this, what exactly do you mean by memory safety issues? Can the code damage your RAM or ROM?
A simple app can take gigabytes of RAM, if bad coded.
I suggest you spend a decade working in C and C++. Or even assembly language. Then you will understand what memory safety is all about and which you had not wasted a decade of your life.
@mikedesanta4612, @toparamennoodles9652 What you are describing is "memory leak", which is a memory bug, but less impactful in sense of "safety". Memory leaks can cause OS to shut your program or cause DDOS attacks, using your server's resources; but that's the limit of damage they can do. On the other hand, there are other memory related bugs that have much serious issues. Like accessing a donkey expecting a whale, trying to get 21. donkey out of 20 donkeys, trying to ride a donkey that is already being riden or trying to ride non-existent donkey. These are dangerous because they can corrupt data, or worst, cause remote code execution.
Accessing memory you are not supposed to, and leaking memory by not freeing manual allocations.
rust has nothing on c++ and requires unsafe mode to use any library. No thank you. Great for itty bitty web apps, god awful for systems programming.
Cry more boomer 😂
The only realistic benefits to pull developers to rust was supposedly faster build time. In fact, c++ build time is said to be generally faster, which is already strike out. If c++ 20’s module system works out and unfolds greatly, I think theres no hope for rust in future. As theres no reason to move.
I can't imagine where you heard this. People have been complaining about build time in Rust since long before 1.0. Grandpa? Is that you? Did you smoke one of those funny cigarettes again? :)
I agree
Equally as entertaining as video before this one...
Rust is the future of programming languages for low-level applications. And it could also have a say in other areas such as the Web, for example in conjunction with WebAssembly.
Which computing languages should i learn to be a pro in cyber security and cloud hacking?
Security is a field for which you need years of experience. There are no languages one can learn to easily be proficient. It would be C and probably some bash though.
Learn how assembly work and maybe some C
It doesn't really matter with which language you start.
nikkiinit TH-camr says learn python, linux and sql--cyber mentor TH-camr says to learn javascript and python--hmmm good luck
Jesus C++hrist