• Shanmugha@lemmy.world
    link
    fedilink
    arrow-up
    1
    arrow-down
    2
    ·
    11 hours ago

    Sorry for intrusion, but mhm, nah. I get it there are people who want to play around and have language/compiler babysit them, but there are also people like me who want to see exactly what something is. So no, Rust, just like JavaScript, can be liked by some people, but it is in no way something that has “best type system”

    There actually is no such thing as best type system, same way there is no such thing as best language

    • [object Object]@lemmy.world
      link
      fedilink
      arrow-up
      3
      ·
      8 hours ago

      If you don’t realize that x = 10 denotes an integer of some default length, and that y = 10.0 is a float, then the language isn’t the problem.

        • [object Object]@lemmy.world
          link
          fedilink
          arrow-up
          3
          ·
          edit-2
          4 hours ago

          You betray so much of what your programming environment is like, with that comment. Because, you see, if you can’t behold the first x= expression on the same screen or, at very worst, the one above, then your code is majorly and deplorably fucked. It’s utterly trashed and is in immediate need of repair. If scrolling back to the first x= expression is overwhelming and exhausting work for you, then the codebase that you work in is mutilated beyond belief and any immediate hope. You need to drop what you’re doing, and get to unfucking you code right away so that you can have it in a comprehensible state that isn’t dependent on reminding the reader on every single line what stuff is like. You need to learn to split things in smaller things that humans can understand as their own self-contained units of meaning. When you reach the balance of formulating the code in self-contained units that can be comprehended easily, you won’t need type reminders on every line.

          Not to mention that if you name your identifiers properly, you won’t have to wonder what their type should be.

    • 5C5C5C@programming.dev
      link
      fedilink
      arrow-up
      6
      ·
      9 hours ago

      I get it there are people who want to play around and have language/compiler babysit them, but there are also people like me who want to see exactly what something is.

      This is a false dichotomy when it comes to Rust. Despite everything I said and despite Lucy’s complaint, there is nothing that actually stops someone from explicitly annotating the exact type when declaring a variable. It’s just not required by the language, and most developers eventually realize that it’s not actually useful.

      You’re right that these preferences are subjective, be although much of that subjectivity has more to do with how our past experiences have shaped what we’re familiar with, rather than any intrinsic characteristics of person. By that I mean, someone who uses Rust enough will most likely come to like the way the general community styles its code, sooner or later. In the meantime you’re welcome to do things in a way that suits your needs.

      The only thing that Rust’s type system is weak on is runtime reflection. There are ways to achieve it within Rust’s type system, but it’s considerably more work than what you get in Python and JavaScript. Imo the only reason to choose a language other than Rust for a greenfield project is if you have a strong need for runtime reflection all over the place and aren’t very concerned about performance, threading, or avoiding entire categories of bugs that the Rust compiler protects you from.

      • Shanmugha@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        7 hours ago

        or that I don’t want to twist my brain with Rust way of things. But I agree with you on everything else :)