I want to learn Rust. There are so many resources available and I am unsure which one to go for, and if there are any tips on getting started?

I am a software developer by trade

Edit: Thanks for all the great replies!

  • tiredofsametab@fedia.io
    link
    fedilink
    arrow-up
    8
    ·
    2 months ago

    I agree with the others who say to start with The Book – https://doc.rust-lang.org/book/

    From there, start trying to create small things that you might want or need to do (parsing JSON is something that I needed to do and I started there).

    From there, you will learn to fight the borrow checker and start to feel how rust is working. This will be annoying at first, but get better over time (at least in older versions of Rust; I haven’t used it in a while so it may be different now).

    • nephs@lemmygrad.ml
      link
      fedilink
      arrow-up
      1
      ·
      2 months ago

      Read the official rust book until you feel like want to experiment with something, then go to advent of code and try something, anything out.

      Then start investigating why it doesn’t quite work. And I guess gpt for suggestions and random questions isn’t a bad idea.

    • Iapar@feddit.org
      link
      fedilink
      arrow-up
      1
      arrow-down
      1
      ·
      2 months ago

      What is the borrow checker and why are people so frustrated by it?

      • tiredofsametab@fedia.io
        link
        fedilink
        arrow-up
        3
        ·
        2 months ago

        Very TL;DR version: a variable has an owner. If you pass it off to another function, you no longer own it and can’t use it until/unless it gives the variable back. Rust can be really strict on making sure you aren’t trying to use something you don’t own at that time. The documentation explains it better than this (and I wrote a longer post but accidentally closed the window and lost it). See also mutability and lifetimes for some pain points people might not be used to.