Slide with text: “Rust teams at Google are as productive as ones using Go, and more than twice as productive as teams using C++.”

In small print it says the data is collected over 2022 and 2023.

  • asdfasdfasdf@lemmy.world
    link
    fedilink
    arrow-up
    2
    arrow-down
    1
    ·
    edit-2
    8 months ago
    1. Look at entire file instead of snippet.
    2. If there is anything that could create a variable x before this area, then that’s where x originates. If not, and if it’s a language where you can create x without using a keyword like let or var, then x is created in the scope in your snippet.

    Types are not necessary at all.

    • Buttons@programming.dev
      link
      fedilink
      English
      arrow-up
      3
      arrow-down
      1
      ·
      8 months ago

      then x is created in the scope in your snippet

      Saying “x is defined somewhere in the entire program” isn’t satisfactory to many users. Also, you didn’t tell me what type x has. Can I do x + 5?

      • asdfasdfasdf@lemmy.world
        link
        fedilink
        arrow-up
        2
        arrow-down
        1
        ·
        8 months ago
        1. That isn’t what I said at all. Reread?
        2. Find references / go to definition / rename has absolutely nothing to do with types.
        • FizzyOrange@programming.dev
          link
          fedilink
          arrow-up
          1
          ·
          7 months ago

          Find references / go to definition / rename has absolutely nothing to do with types.

          It absolutely does. Without static types an IDE/LSP can’t reliably find all the references / definition and therefore can’t refactor reliably either.

          Consider something like this:

          class Foo:
            bar: int
          
          class Baz:
            bar: str
          
          def a(f: Foo) -> int:
            return f.bar + 1
          
          def b(f: Baz) -> str:
            return f.bar + "1"
          

          Now imagine you want to rename Foo.bar or find all references to it. Impossible without the type annotations.