Why You SHOULDN'T Learn Rust

210,823
0
Published 2022-12-13

All Comments (21)
  • @ThePrimeagen
    i would say one thing you missed one important point which is that the type system is the reason why so many people love rust. Performance is not the first reason why people love rust. And one interesting thing is that there is no equivalent in js. there are simply things you can do in rust you cannot do in ts / js for types.
  • @dog4ik
    Primeagen's next video: Don't learn JavaScript
  • It is almost strange to hear about people being blown away by how fast Rust is. This is how fast computers should be. We've had decades of folks being so far removed from bare-metal performance that they really have no idea just how fast their laptop really is.
  • @irlshrek
    Learning rust has made me so much better at typescript and likely every other language
  • @kortes8914
    "The fun of serverless is: if you have a memory leak it doesn't matter, the instance dies and gets remade" The developer inside of me died hearing that.
  • @bjo004
    4:07. That mindset for JavaScript, "we don't care about memory leaks because the lambda instance doesn't live long enough" is a bad habit. Your code should not have memory leaks (whether long lived or not).
  • @levizin917
    Rust is slow to program in, and hard to get in, but when my company relied on typescript solely all of our critic services were error prone, after switching to rust we have a hard time coding and a easy time mantaining
  • @pictureus
    I write typescript all day at work, and whenever I can relax and code with Rust again in my spare time; it's such a ethereal experience. The borrow checker and type system helps you structure your code better I feel like and that experience carries over to my day to day work as well. Pattern matching, The Result and Option enums etc are some of the most commonly used things I miss in Typescript.
  • I think the big issue with comparing JS/TS with Rust is that they're designed with completely different goals in mind. I wouldn't throw together a website in Rust, just as I wouldn't build a kernel driver in TypeScript. Learning Rust has given me a massive appreciation for how easy languages like Python and TypeScript make it to develop complex code at a rapid pace. However, working with Python and TypeScript has given me a massive appreciation for the level of safety that Rust provides. Rust is the only language where I have ever felt confident in my code working the first time around if it compiles successfully, and it certainly has made it so that I don't want to interact with C or C++ ever again.
  • @snk-js
    I think typescript is not synonym for safety. It's just checks your types in compile time but in runtime it's still javascript, I can still make the program do what is not intended to in the devtools.
  • I'm a backend dev and use Rust for very specific things. Recently I had to write a json validator for a batch job operation and it went from 10's of minutes to under 10 seconds. The json needed to be 100% correct, down to the types, and Rust was great for this sort of problem. Once WASM becomes more common, which is inevitable, Rust is going to explode in terms of demand and popularity.
  • @snatvb
    Learn Rust. As second laguage. This will make you a very strong developer. Rust is young - that's why it has such problems with tools or libraries also this reason why with Rust hard to find a job. But it still cool language that give more deep understaing how programs work, how memopry works, CPU, Garabage Collector and etc. When you are senior FE developer, you should understand this for fix perfomance issues or memory leaks or prevent it while you writing code / planing architeture. The best that I like in Rust - it hasn't null pointers. I like it so much...
  • @TheComodous
    Agreed with most of what you said but it gave me shivers down my spine when you said serverless takes care of memory leaks. A car that only works for a year is a bad car, even if you don't care because you buy a new one every six months.
  • My experience with Rust is it takes more time to code but less time fixing bugs afterwards. One way to think about it is the debugging process is moved from after the fact to into the coding phase ie the bugs are caught by the compiler and thus fixed immediately rather than at runtime. This is of course not 100% the case. But it is very hard to actually judge how much debugging/later bug fixing / customer issues you have saved by using Rust. Its similar to unit tests, that take work to create but reduce work in later phases, but is often hard to judge their usefulness as how much a unit test saves varies wildly depending on the type and complexity of the code being tested.
  • @caderosche
    I find Golang easier than TS, yes it has some weird parts but they aren't weird in a complex way. You get used to them very fast.
  • @sharperguy
    The biggest issue I'm having with Rust is that half the projects I want to work on, the libraries are still experimental or one feature I need isn't implemented yet. With typescript, since there is a huge community behind it and many $$$ this tends not to be the case.
  • @user-zd9wd
    Rusts borrow checker doesn’t just limit you - it also gives you the opportunity to have more control over how you design your data structures but the satisfaction you can get from that only becomes apparent when you become fluent in it
  • I'm gonna hard disagree on the DX with typescript. The headaches involved in making sure all of the modules you want to use are properly configured to be imported into your typescript and compiled to your chosen target tend to distract me terribly from the task at hand. I'm always getting unexpected import errors that I have to solve by downloading some kind of @types package which almost inevitably seems to be outdated or otherwise incompatible with what I see in the package's documentation. Maybe I'm doing it wrong, but it's been a lot more of an obstacle than an asset for me, at least on the back end. I did have a little better time working with it in Solid JS on the front end, though. Less dependency management issues, I guess because I used a pre-built config that was pretty good at solving module problems automatically.
  • @ambuj.k
    I'll have to disagree with you here, Theo. Here are my counterpoints. 1. Rust is expensive at investment but pays off very well in future than javascript or typescript because it forces you to handle all exceptions and invariants at compile time. If you're a startup or too short on time or just program 9 to 5 for money, don't use rust. In many cases, node js can crash at 2 am and everyone will be losing sleep over why the server crashed just because there was an unhandled parameter in the request. Even though vscode warns you about (string|undefined) value in ts, you have to put an if statement to check that, in rust you can do that with just a question mark. 2. Serverless is a wrong argument against multithreading in rust, because serverless is more expensive than running an equivalent ec2 instance. If you used rust instead of javascript on a 2 vCPU server, you'd be handing out 100x more requests per seconds thanks to tokio than node js and that also on double the number of instances of the same app on 2 courses. 3. Also, why is theo talking about community efforts for javascript but not rust, He is not seen talking about the community efforts in creating tokio(an async library), serder(serialization and deserialization library) and sqlx(sql driver for rust with compile time checked queries without a dsl) for rust. You don't see that kind of community support for any low level language.