• panda_abyss@lemmy.ca
      link
      fedilink
      arrow-up
      27
      ·
      5 months ago

      Reminds me of java

      I have Toolkit toolkit = Toolkit.getDefaultToolkit(); seared into my brain. Then there were the bean factories…

      • Frezik@lemmy.blahaj.zone
        link
        fedilink
        arrow-up
        16
        ·
        5 months ago

        At least with Rust, there is a specific, defensible goal for why it does that.

        Java is just over designed. All of java.io reads like somebody’s Object Orientated Programming 101 final project, and they’d get a B- for it. Lots of things where you can see how they’re abstracting things, but there’s no thought at all in bringing it together in a tidy way.

        • Fiery@lemmy.dbzer0.com
          link
          fedilink
          arrow-up
          5
          ·
          5 months ago

          Not like C# is all that much better. So much garbage in the fundamentals just because it was done that way at the start and “they can’t change it now”. The best example is the IList interface.

          Theoretically this interface exposes both index-based access and collection-like modifications and as such would be perfect in a function if you need those two features on a type. In reality you can’t use it as a function parameter because half the official types implementing IList aren’t modifiable and throw a runtime error. E.g Arrays

    • shape_warrior_t@programming.dev
      link
      fedilink
      English
      arrow-up
      18
      ·
      5 months ago

      Even regular Rust code is more “exciting” than Python in this regard, since you have a choice between self, &self, and &mut self. And occasionally mut self, &'a self, and even self: Box<Self>. All of which offer different semantics depending on what exactly you’re trying to do.

      • dejected_warp_core@lemmy.world
        link
        fedilink
        arrow-up
        8
        ·
        5 months ago

        I’ll add that 100% of the above is understood by the compiler. Unlike Python or JavaScript where you don’t know how bad you have it until the program is already running.

        • Lightfire228@pawb.social
          link
          fedilink
          arrow-up
          7
          ·
          5 months ago

          At least python has a decent runtime typing system

          JS’s type system feels like what you’d get by giving a monkey access to unlimited cocaine and a computer