• TheTechnician27@lemmy.world
    link
    fedilink
    English
    arrow-up
    18
    arrow-down
    6
    ·
    edit-2
    20 hours ago

    As someone who routinely works on a complicated C++ codebase, had to use C, Python, and Java all the time through school, has had to use absolute trash like JavaScript and PHP, and has dabbled in languages similar-ish to Rust like Go and Swift, Rust to me is simple to work with.

    The compiler is extremely helpful when I do something wrong, it has sensible conventions like immutability by default, Cargo is a streamlined build system, I’ve found the documentation easy to read, I actually prefer curly brace-delimited scopes to tabbed ones and explicit type declarations for readability, and in the obvious comparison to C/C++, Rust lacks extremely common memory footguns.

    Obviously compared to Python – with its mountain of syntax sugar and a library for everything – Rust is going to be more difficult. But for languages in general? Rust is not at all one of the harder ones I’ve learned or used.

    (Btw I hate Java; it’s the worst language I’ve ever used.)

    • banshee@lemmy.world
      link
      fedilink
      English
      arrow-up
      2
      ·
      15 hours ago

      I’ve had a similar experience. Yes, I have had days where I spent a significant amount of time beating my head against the wall, but that’s part of the learning curve. Those days stretched farther apart pretty rapidly.

    • Jerkface (any/all)@lemmy.ca
      link
      fedilink
      English
      arrow-up
      4
      arrow-down
      1
      ·
      17 hours ago

      How many times have you spent an entire day not moving forward on a project because you couldn’t figure out what the borrow checker was trying to tell you? Maybe you’re just a 10X developer.

      • Miaou@jlai.lu
        link
        fedilink
        English
        arrow-up
        1
        ·
        edit-2
        6 hours ago

        Which paradigm do you even refer to? Lifetimes? A C++ developer who cannot understand lifetimes (at least conceptually) in a day is a terrible developer.

        I would know, I work with such people.

        To answer your first question, I’ve definitely spent days of my life trying to fix c++ templates because the compiler won’t fucking tell me what’s actually wrong. It loves telling me some unrelated copy constructor is deleted though… And all of that is actually worse with new stuff like ranges. Which are great on paper, but are a maintainability nightmare.

      • Nate Cox@programming.dev
        link
        fedilink
        English
        arrow-up
        4
        ·
        15 hours ago

        You’re right that the first steps with Rust can be trying, but I do think it gets overinflated.

        Of all the languages I have both learned to use and deployed something useful to production in, Rust is somewhere in the middle of the “initial difficulty” curve. Harder than Ruby, Python, Perl, C, etc… easier than Erlang, Elixir, Clojure, Haskell, etc.

        Rust’s borrow checker is both its best and worst feature; virtually every complaint I have heard about how hard Rust is was about fighting the borrow checker, but the borrow checker has also saved me from some really stupid mistakes and all of the time involved in finding and fixing them. The juice is totally worth the squeeze.

        Now if you really hate yourself spend some time learning Prolog. I promise you that Rust will seem a lot more dev friendly afterwards.

        • TheTechnician27@lemmy.world
          link
          fedilink
          English
          arrow-up
          6
          ·
          edit-2
          14 hours ago

          I’m surprised you put C in there. Its limited vocabulary does mean you don’t have to deal with e.g. C++'s 50 million ways to do something, but this combined with a lack of guardrails makes it agonizingly difficult to do a lot of basic things – most notoriously dealing with strings.

          I actually consider C a good beginner language, but only in the sense that 1) it does have that simple toolkit, 2) it and its descendants are widely used, and most importantly 3) the bullshit C makes you deal with gives you a better understanding of what higher-level languages do for you automatically and why. To me, it’s probably the hardest mainstream language to learn after maybe something like x86 or ARM assembly (which, for better or worse, hit points 1 and 3 even harder than C).

          I generally agree though that Rust has always been somewhere in the middle for me.