• pewpew@feddit.it
    link
    fedilink
    arrow-up
    10
    arrow-down
    8
    ·
    13 hours ago

    What part of Rust is fun?

    C is fun to me because the syntax is easy to understand and straight to the point. C is also great for learning low level coding, I find Rust so confusing

    • asdfasdfasdf@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      2 hours ago

      Rust us way easier to understand for me (and I’d guess most people) than C.

      Rust is fun because it’s the only mainstream language with an affine type system, which allows some really cool patterns like the typestate pattern. And the fact that there’s no inheritance or null or exceptions is amazing.

      • Nalivai@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        5 hours ago

        The first picture isn’t what people write, even though it’s technically compilable, it’s not what C is.
        The second is a normal syntax, pretty simple to understand if you write enough code.
        C is very simple language at it’s core, and it allows for it to be used in a very complicated systems.

      • db2@lemmy.world
        link
        fedilink
        arrow-up
        5
        arrow-down
        11
        ·
        10 hours ago

        Were you trying to post examples of it being easy or do you actually find those hard?

        • esa@discuss.tchncs.de
          link
          fedilink
          arrow-up
          5
          ·
          7 hours ago

          I find the C type syntax turgid. It’s fine for the most basic types, but the name-in-the-middle style doesn’t scale at all, and it’s not hard to understand why later languages separate name and type, no matter which side of the name the type goes on.

          I find Rust easier to read in that regard, even though picking <> for generics was likely done to be familiar for C++/Java types rather than easy to parse. (See also: the bastion of the turbofish)

    • slacktoid@lemmy.ml
      link
      fedilink
      English
      arrow-up
      18
      ·
      13 hours ago

      Rust requires you to unlearn some of the C and CPP habits. And so it’s like learning a language that approaches things differently. That is pretty fun to see how another language solves a problem etc. I think rust is a very fun and interesting language tbh. But you are free to not like it, that’s all good man. That’s why we have different languages. After getting into rust, for me, you need to convince me to use C or Cpp, they have their niches for sure, but rust allows that too like embedded programming etc.

      • BrianTheeBiscuiteer@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        8 hours ago

        This checks out. I tried some Rust coding challenges and couldn’t get my stuff to compile mostly. When I see the solution it seems straightforward but also not intuitive.