Recorded live on twitch, GET IN

    https://twitch.tv/ThePrimeagen

    Reviewed article: https://medium.com/@ChadJohnsonOfficial/why-rust-is-stopping-your-success-use-c-and-c-instead-586dc7e2edbc
    Author: Chad Johnson | https://medium.com/@ChadJohnsonOfficial

    MY MAIN YT CHANNEL: Has well edited engineering videos
    https://youtube.com/ThePrimeagen

    Discord
    https://discord.gg/ThePrimeagen

    Have something for me to read or react to?: https://www.reddit.com/r/ThePrimeagenReact/

    Kinesis Advantage 360: https://bit.ly/Prime-Kinesis

    Hey I am sponsored by Turso, an edge database. I think they are pretty neet. Give them a try for free and if you want you can get a decent amount off (the free tier is the best (better than planetscale or any other))
    https://turso.tech/deeznuts

    I don’t know if you know this but rust is stopping your success ++ that’s all the title says okay and it’s by a man named Chad I mean the man’s name is practically Robert swellington uh this is going to be exciting I’m very excited for this I

    Will say one quick thing at the very tippity top of this I haven’t really used C++ Beyond C++ 11 cuz that’s what our compiler’s been largely stuck at and so that’s all I’ve really ever known I know C++ gets a lot better I know here’s Here’s To Me hoping that modules really

    Actually will one day work feels like copium here we go here we go all right by the way oh look at that poor crab look at the poor crab uh programming languages are tools not religions yes I don’t know if you know this but the term religion I believe comes from the French

    Term religion religion which actually comes from the uh Latin term aari which means to hold on to it invokes an idea of you being on a ship and people this was actually a common term before it became a term term for what you believe in but you would really gar a rope while

    You are on rough Seas right just a fun little fact you would hoddle a rope okay and so this was very very important uh understanding so our programming tools something you you grasp onto in the wavy Seas well I mean one could one could see

    A bit of a connection there you know one could see a bit of a connection maybe that’s why it’s so deep so difficult so backd door wanging you know unfortunately you can’t use jokes from other videos because backdoor Wang means nothing here sorry if you don’t know FTX

    You don’t know backd door W uh anyways sure rust has its Merit memory safety without garbage collection yada y y but let’s talk about getting actual Market ready products out the back door that’s where languages like C++ and C sharp Shine the borrow Checker a double-edged sword oh this okay this actually could

    Be a great take I actually could really like this take okay let’s see it ah the borrow Checker Russ claimed to fame it’s like the overly cautious friend who won’t let you climb a tree because you might fall and break a leg it’s supposed to help you by enforcing strict rules to

    Avoid common pitfalls but in practice it often feels like you’re wrestling with it just to get your code to compile and every minute you spend doing that is a minute not spent developing features fixing other kind of bugs or literally or doing literally anything else

    Productive okay so I I guess I have a slightly different take on that one like in some sense I understand what he’s trying to say but there’s kind like the classic understanding of of of rust which is no I want a tech I want to I

    Want a text way up here which is all safe programs and then there’s rust allowed programs right this is kind of like the the notion oopsies the the notion that you kind of have to have in your head when you’re using rust which means that if you design a program that

    Is safe but as you program it it’s not rust safe you therefore are going to fall into this really big fight with your compiler even though you’re doing a safe thing and I think this is where most people’s big gripe with rust comes from is not the fact that they want to

    Write safe programs it’s that their program which is safe cannot be uh expressed in Rust and I think that that can be very very very annoying it’ be very annoying and yes someone just said if you’re fighting with the Bor Checker you don’t know rust no that’s not true

    At all do any sufficiently sized program and you will start fighting with the borrow Checker at some point right uh you don’t fight with the borrow Checker uh if you write it in the rust way which only comes when you have uh written many of them yeah I know but that’s the

    Problem is sometimes the rust way is unclear because no one’s really done it yet so you have to like fight your way into this and when you have to refactor you have to like really refactor your way back out which can be very difficult right refactoring is I find it more

    Frequent in my rust programs is it good is it bad not sure it’s a skill issue it is a skill issue it just happens to be an amazingly difficult skill F again striving for Perfection at the cost of progress here’s the kicker with rust you’re basically expected to write

    Perfect code from the get-go that’s not true at all I wrote several bugs in mind just recently in fact I wrote one that all my clients timed out because I’m a stupid idiot uh sounds great in theory but what if you are in a startup environment or any fast-paced

    Development cycle you need the ship products fast to even see if they’re worth refining if you spend all of your time wrestling with the borrow Checker to produce perfect code you’re burning time and time could been used to do uh used to actually test your product in the market uh most products are

    Extremely simple most things you’re solving that you’re doing aren’t complicated I kind of doubt with this in general I think that most people that are really familiar with axom with the database with testing can produce pretty much equal uh honestly they can produce like equally good stuff in about the

    Same time I’ve seen some people that can move very very fast if you’re really familiar with the uh product you can move pretty dang fast um it’s just most people aren’t that familiar you know what I mean it’s called MVP you can use pyth py for yeah you can also use Python

    You can use JavaScript I don’t think there’s anything wrong with saying you should use if it’s an MVP you can really use any language you want just use the language that you’re the literal fastest with if your only care is to get something out the door just honestly use

    The language you’re the fastest with if you love PHP donuts with LVL invite Taylor otwell over for dinner have a fine glass of wine laugh a little bit and write your product in PHP nobody’s going to care right uh Cobalt go for it uh time is money and compilers don’t pay

    Bills here’s the harsh truth your boss doesn’t care about the theoretical benefits of zero cost abstractions if it takes twice as long to ship the product with languages like C++ and C you spend less time fighting the language and more time writing the code that does stuff

    People actually pay for C+ plus and C have a rich standard libraries and Frameworks that uh let you stand on the shoulders of giants rust not so much rust does actually have some really great Frameworks right you got a solid like implementation that you can SSR and

    Do templates with with uh such as uh what’s it called lepos it has quite a few different templating libraries um it has really amazing handlers like again this just sounds like familiarity right this is just familiarity more than anything else productivity over Perfection garbage collect collection in

    Languages like C might be sneered at by hardcore system programmers but guess what it lets you move fast I agree with this it’s easier to write a program you can be significantly less familiar with c and write a program faster just like me with go yesterday I literally wrote

    This in 10 minutes to do a quick websocket test just to see how good I was at writing a bit ago 10 minutes in never used the library never used any of it boom got it up and running super ultra simple it is shocking how easy those things are and

    In the business world uh often let’s see speed often trumps perfection in a tiny memory leak in a non-critical path is the cost of getting a product out six months faster most businesses will pay that price uh gladly Fair uh but I doubt that that’s the trade-off people are

    Making here here uh ecosystem support C++ and C have been around the block they have massive user bases extensive libraries and a wealth of online resources so I think this I I don’t think anybody here would have a problem in some sense with this article

    If it was C I think the thing that’s really triggering people is the C++ you know again I I’ve been harping on this phrase recently which is it takes a complex language to tackle the complexity of some problems and therefore you write simpler code a simple simple languages make more comp

    Your complexity is either in your language or in your application right I think that’s the common phrase I would just like to I would just like to State as a counter example C++ perhaps one of the most complex languages ever in which you can enjoy both the complexity of the language and

    A complex application all you would like together at the same time because that’s what you get it’s going be very very difficult uh anyways they have massive user bases extensive library with wealth of online resources if you run into a problem chances are someone else has two

    And the solution is just as quick Google search away rust is getting there but it’s not at that level yet the it works Factor by at the end of the day businesses care about solutions that work C++ and C have a long track record for working well in a variety of domains

    From game development to web backends to embedded systems rust might catch up one day but for now it’s more of a gamble yeah I mean I get it for game development absolutely embedded systems it’s getting pretty dang good right I used it like what last year and

    It worked with just all the hardware right out of the box with Arduino stuff it was like pretty easy you know it was pretty dang easy Russ isn’t suitable for Rapid development Cycles where time to Market is a priority sure it has its benefits blah blah blah blah blah blah

    Um none of this makes any sense the whole C and then C++ thing it’s really this is where it falls apart if you’re just saying use a garbage collected language to get your product out the door I buy that argument right Java go C JavaScript whatever your like fancy is

    For the garbage collected languages if oh camel right if you use one of those I think you’ll I think that argument makes a lot more sense right I think you could make a really strong argument there but when you throw this in I just don’t like

    It doesn’t make any sense at that point oh camel my camel my camel my camel it just doesn’t make any sense there’s so many hard things about C I mean like or C++ like how many ways now how many different R&L value combinations of assigning mem copy on assignment versus

    Move semantics versus I mean how many Constructors do you need to have these days is there six separate Constructors these days I know there was like the rule of four now is it has it has it grown I swear I saw something that’s like now there’s six Constructors zero

    Or six the rule of five dang it is it five it’s rule of five dang it okay I was wrong see that’s I mean That’s how little I know about C++ I mean i’ I’ve always done it I just haven’t done a lot of it I’m going to give my verdict on

    This should you use a garbage collector or non-garbage collected language in all reality I don’t really care what you use long as if you’re going for speed just use what you’re familiar with use what you’re you’re the best at cuz honestly you’re going to be the best at that

    Thing and it’s going to be you’re just going to do well if you really are not sure you’ve done a lot of dabbling through a bunch of languages and you’re really not sure which one you want to choose I’m still I’m still that go is just really effing simple to get off the

    Ground every time I use it I go H this if air equals no business I hate it but then I program something and I get it done pretty quick and I’m pretty much mostly correct off the rip and I go gosh okay it was pretty easy to do damn it it

    Was really easy to do but man I don’t love the language right it’s just boring I don’t want it I want I want to just I want these complexities I want these type systems that are incredible I want all and then I still just just get stuff

    Done and go and then I sit there and think am I the unreasonable one am I the right am I the I might just be the just refusing to use something because I’m like it’s boring gosh this is boring like I don’t like

    Ready and go I do not like ready and go yet it’s just so easy every time I just hate it like all you need to know is channels and how to start a G Funk and you pretty much know almost everything about go it’s shocking it’s primitive of

    Course it’s primitive and it’s primitive to its own fault I don’t love it for that reason I find myself doing boring things I don’t want to do right I wish their standard library was more complete it’s becoming way more complete since they introduced generics but still it’s

    Kind of boring uh broad channels are dude channels are amazing and go channels and go are tremendously better because they have syntax support right if rust had syntax support on channels it still would be a pain in the ass because you need this left and right

    Hand side right and so that’s what kind of a big pain in the ass whereas go like you just don’t need to do that there is no left and right like you just have a channel and you either push it in or you pull it out and like that’s that that’s

    Great it’s unnecessary laborious I know so is every other language when you’re doing stuff with Java JavaScript you’re still doing a bunch of pretty mediocre string operations you know what I mean it’s like when you’re doing string stuff in JavaScript you’re just like I mean it’s

    Still really annoying to do it it’s not like it’s somehow way easier don’t bring up JS in this uh go is easy to start with but it has a lot of foot gums I work professionally with go and there are so many rough edges that you have to

    Be aware of books like 100 mistakes and go are a mandatory reading in my opinion oo interesting I like to read that so yeah easy to start with but it has a lot of hidden foot guns okay yeah yeah I haven’t worked any I’ve only worked in small or mediumsized go projects I’ve

    Never worked in like a large one when I say large I mean 25,000 plus lines right 25,000 plus lines you could convince me that that’s a large project right I I have looked at your uh chat history I’m sorry but you’re just you’re harping on C++ 14 17

    20 23 I see what you’re saying it’s just not compelling okay I’m not going to read it I’m sorry I do read your chat it’s just not worthy to be read out loud and now you’re making me do it here okay sorry um no that’s like Ultra large

    That’s Uber large okay that’s Uber large there’s very few projects that are you know in the uh yeah that was great sorry I’m sorry I tried I tried to be polite about it I wasn’t trying to dog on you I do I do read I do read your chat I just don’t

    Think it’s all great to be said the name is it did you like And subscribe a CH

    36 Comments

    1. ~2:10 : the borrow checker double edge sword argument stating "Every minute doing that is a minute not spent developing features, fixing other kinds of bugs, or doing literally anything else productive."

      While I've only dabbled in Rust for a few days months ago, that precise arguments reminds me the same argument used towards version control systems, good documentation, good decoupling, etc… while I can agree with that for super small personal projects where you're the only one to deal with your own stuff, in a team wise perspective, that's ignoring the amount of time and boredom saved tracking the origin of a memory leak…

    2. I think the "fuck quality let's just get it out the door asap" mantra is completely fucking backwards. If that kind of mentality existed in ANY other profession it would rightly be called out for what it is, but for some reason in software we just let it slide. It's an embarrassment to the profession imo. If your boss is more concerned about time to market than the quality of the product then you have a shitty boss who is helming an unsustainable business doing nothing but accumulating technical debt.

    3. The fundamental issue is complexity… I already know C++, and I look at Rust, and all the "safety" features make it feel like way more effort than it's worth. C++ is already too complicated for most people, Rust is just overly pedantic imo. Plus, I like to have full control over my code even if it's unsafe, because at the end of the day I care more about squeezing out every millisecond of speed I can get from my code, and I can fix any memory issues which arise since they are very easy to detect. Then there's also the issue of code readability, and I'd much rather look at C++ than Rust.

    4. You are programmer. Your job is to do programming. Part of programming is takin care of memory and safety. Dont complain about that.
      Borrow checker is absolutely wrong premise which render most of well known algorithm's difficult or impossible to implement regular way, so rust devs use unsafe block. F*ck that language.
      Even more, rust community usually doesn't react well on criticism. If something isn't applicable in Rust then its bad or wrong.
      C++ went too wild. It's on completely wrong track. Auto, rvalue, lambda, unreadable templates, is a complete BS. They invented auto because they cannot read their own code.
      Luckily you can do programming cpp w/o such "features".
      At the end… If you are the user of library/framework/module, RTFM before use. If you write a library, put yourself in users position and design your library in a way that user can use it properly.
      And stop this nonsense language wars.

    5. but C++ is easy, you start with mostly C code, and add features as you see fit.
      most programs don't need a move-copy constructor, most programs don't need a && in them.
      the ones that will need them will use them.
      this is really why you mostly teach the c89 and c++98 for first time users and expand from there.
      sadly, c++ doesn't benefit from many of the expansions of later versions of c and they also have different standard libraries.

    6. Rust have a way bigger problem, not even listed.

      When you depend on 450 crates to make a simple program.
      Supply chain attacks are real.

      Except if you audit every single crates and every of there own dependencies, you have no clue about how safe it is really.

      NodeJS and Python have the same problem and have been attacked many times. Only reason rust did not is that it have less prays, for now.

    7. I've been using primarily C++ over most other languages for years. Now, each and every language has its own pros and cons and C++ is no exception. So I'm going to try and propose this think piece without using my own preferences to any given specific language. I'm trying to do this in an unbiased manner. So here it goes…

      When you have production code that isn't necessarily used just in the business sectors of our current technological progress, but is used in critical systems where human life is at risk such as in a Nuclear Reactor, as in the Guidance System for Airplanes or Ocean Liners, as in Traffic Controllers for either Ordinary Highway Traffic or even for Railway Network Systems, or code bases that are within the medical community within advanced equipment such as MRI machines, Catscans, X Rays, and other diagnostic systems… My question then becomes Which Language are you going to Trust the Most to ensure the least amount of critical errors are present to prevent any kind of harm to human life or severe damage or destruction to any of these vital systems? I think this is more important than arguing over the semantics of a given language. And the answer or consideration of this question is where some languages do shine over others… Sure when a particular application has no direct influence on harming another person or potentially causing damages in the millions or even in the billions such as a piece of code to operate a remote control for a television, or a network piece of code for audio or video playback, or a piece of code to track recent sales then the language here doesn't really matter. Yet when you go beyond that and you are responsible for a code base that is used in critical systems such as a piece of code within an automobile that determines if it should apply the breaks or not, or to deploy the airbags, etc… which language are you going to trust? This is less commonly talked about in many circles when there's a debate between one language versus another… Let this sink in for a few moments!

    8. I think people who dislike rust and the borrow checker just have a completely wrong approach to the language as a whole. You dont fight with the borrow checker just because, you do so because it saves you time later down the road and it does so exponentially

    9. my take is that if don't know go or rust and have a week to learn either and build something you should probably go with go, however, if you master both, rust will be a lot more productive in my opinion.

    10. Hey yall, fun fact. That article and the entire account is AI generated. I know this because I commented that it was and my comment was swiftly deleted. I then that it'd been deleted and I was then blocked within the hour.

      People in the comments, both in this video and the original article, are arguing with the "author" like they're discussing actual opinions. The article is clickbait to the absolute max.

    11. Ugh, I've seen this Chad Johnson guy elsewhere before. He literally just makes hate bait articles to try and rile up a response to his mediocre bs writing.

    12. stop using both use straight C and only classes if you really need it otherwise structs with function pointers intelligently written funcs and well written code always win

    13. Personally I do not enjoy rust I tried it for 3 projects and its just extremely restrictive even if the code I am trying to write is completely safe it won’t let me do it

    14. I´m late to the party, i know. As a beginner game tools engineer in C# and C++. I agree most of it, especially to get a faster result in order to satisfy the investors or or someone else for whom you are responsible. BUT I started to learning rust out of own interest (and of course you @ThePrimeTimeagen gave me the excitement and motivation) it IS totally satisfying to get good results in rust even if it takes longer. You have to be open do it. A more spiritual or philosophical way of thinking and acting. Much love from germany ❤🤙👀

    15. Somebody once told me "Go is so boring!", and I thought: "Yea, this could be my cup of tea! I have kids, and I need to get things done. I don't need creativity in my daily business…" 😀

    16. Some stuff in Rust is also difficult because you're used to terms meaning perhaps a slightly different thing.

      Like I was making an engineer calculator and thought enums would be perfect to avoid clunky if statements with odd characters or numbers to guide the menu. I came from C++ and little did I understand what it would mean if you wanted to make the menu in Rust enums. That was a night spent browsing documentation and google and thinking I really don't know what I thought I knew. The pattern matching for example tripped me, especially because the user input led to results etc etc. All those features are great but oh boy it wasn't just a lovely walk in the park to choose enums at that point of learning.

      I thought it'd be a switch case with EXIT being secretly 5 or something, surely Rust would allow me to do the same thing as C++ but hundred times better. Nope, I didn't know Rust yet.

      I'm actually turning my ship a bit regarding Rust. I loved the idea and I really liked some idiomatic stuff, but I've also greatly considered the value evaluation of an engineer: does this time equal to improved value in the eyes of the customer. The answer so often with Rust is no, it results in your personal growth with little increase in value for most customers. They don't get to observe how beautifully memory safe your program is, because a lot of let's say C++ tooling these days catches you if you actually still made some memory silliness, even though at this point you've probably learned what things to avoid and what safeguards to use, plus the inclusion of range for loops and similar have helped a ton with how difficult the language is to write acceptably safe.

      Having said that, professional and high level C++ would be atrocious and cargo just kicks ass, not even worth to talk about C/C++ in that regard. But C++ community is also working hard nowadays trying to come up with ways that make C++ better to write, particularly when the going gets nasty. Even if they can't fix the defaults necessarily. C++20 in gcc is already pretty nice, just waiting for the 23 to hit the deck because formatted prints and stuff really interest me. And pattern matching already being there. So you always seem to make these trade offs you wouldn't like to have to begin with and Rust still feels like a work in progress in ways, despite the marketing speeches. And the learning curve feels massive compared to some other languages where you can just hop on the saddle and dash if you're familiar with some semi-common language. Is that why zig or ocaml might be taking over rust in the future? Maybe they are the productive and convenient to write languages that offer the best of imperative and functional world and allow memory fiddling when necessary. "How hard could it be to write that perfect language?"

    17. I gave Rust a go coming from a c++ background.. the “learning curve” isn’t really technical based, it’s more on how you are used to learning and your approach.

      Rust has the vibe as the C killer language, that’s going to takeover, etc.. “it’s basically C but memory and type safety”… so you go into it, thinking it’ll be like another C bastard language like C# or something with its own spin to make it unique… wrong, it’s a totally different language.

      And the “security” hype is bullshit exaggerated bug prevention… Making an app in Rust will not make it any more difficult to reverse engineer opposed to a C app… and if you want better type and memory safety in C, just get better at C?

      So I started Ocaml, been maybe a day just playing around with stuff like file IO to get used to it… and it has all the same stuff Rust offers, the strictness and stuff BUT less code, and more appealing (in my opinion) … so I lm just like, why don’t I just write the sections of my app that need to be pretty “flawless” in Ocaml instead? Like why would I scrap my repo and build it in Rust…

      I think Ocaml is definitely a much better option than Rust imho… just write the sections you need “safe” in Ocaml and the rest in C… it’s faster, simpler and provides the same benefits as rust

    18. OCaml > Rust… Just write the stuff that needs to be “safe and secure” in Ocaml, it’s easy and provides same hype features as Rust. Absolutely no reason to drop c++ to main Rust.

    19. When you're done fighting with the borrow checker and have a working safe program, you're done. If you're bitten by a safety bug it can eat your time when you don't have time, or ruin your product's reputation. The C++ community seem to be fussing over safety now, after the NSA has officially recommended avoiding memory-unsafe programming languages.

    20. It's been about 12 years since we first heard of Rust, and despite the extensive marketing campaign it has received, it is still considered a niche programming language. Don't get me wrong, I'm not saying Rust is a bad programming language. In fact, it might be better than C/C++ in many aspects, but its approach forces developers to either write everything from scratch or deal with the pitfalls of the 'extern-function approach' for integration with the outside world. The industry has invariably proven that this approach is a failure from day one. A very good example of this is the Dart programming language. It was originally intended to replace JavaScript, and despite being better than JavaScript in many ways, it miserably failed to do so. Similarly, Rust is unlikely to succeed in replacing C or C++. Rust and C++ are fundamentally incompatible. I see more future in replacing C/C++ with other approaches such as CPP2 or Carbon if the first production-ready versions of those languages are released, which seems very likely to happen soon. Once that happens, there will be even less chance for Rust to replace C or C++. Also, note that C++ and TypeScript are very successful languages in terms of adoption because their approach doesn't require rewriting everything from scratch. You just change the extension from .js to .ts in your JavaScript programs and start seeing results in terms of migration right away. Similarly, with C++ and C; you compile a C program with a C++ compiler and start seeing results. That's why industries are reluctant to migrate to Rust. This approach is in opposition to code reusability, which is too important to give up.

    Leave A Reply