• TomMasz@lemmy.world
    link
    fedilink
    English
    arrow-up
    66
    arrow-down
    1
    ·
    1 day ago

    LOC is a terrible metric. The worst programmer I ever had work for me had the highest LOC of anyone on the team, and his code was crap that barely worked.

    • Flamekebab@piefed.social
      link
      fedilink
      English
      arrow-up
      39
      ·
      1 day ago

      Is this why so many of these fuckheads are keen on LLMs? They’re great at vomiting out reams of code.

      • AA5B@lemmy.world
        link
        fedilink
        English
        arrow-up
        6
        ·
        24 hours ago

        My biggest objection is unit tests. LLMs can actually be a useful tool for populating out unit tests. But of you let them run amuck, you get vast quantities of tests that add no value but now you have to maintain in perpetuity

        This one junior developer didn’t notice the ai brought in a whole new mocking tool for a few tests and didn’t understand my objection.

        • black0ut@pawb.social
          link
          fedilink
          English
          arrow-up
          1
          ·
          2 hours ago

          Relying on a chance machine to thoroughly test your code sounds like a recipe for disaster

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

          LLMs can actually be a useful tool for populating out unit tests.

          My experience with this is the LLM commenting out the existing logic and just returning true, or putting in a skeleton unit test with a comment that says “we’ll populate the code for this unit test later”.

        • Flamekebab@piefed.social
          link
          fedilink
          English
          arrow-up
          7
          ·
          22 hours ago

          I had a dev add a load of unit tests that mocked values and then tested for the mocked values. I mean… They passed…

    • magic_lobster_party@fedia.io
      link
      fedilink
      arrow-up
      11
      ·
      1 day ago

      In my project there has been this guy who produced more lines of code than most other. All of his code is a terribly convoluted mess no one can work with. Also buggy and slow as hell. It’s been many years since he left the company, and the negative effects are still seen today.

      Luckily we’ve been able to detach ourselves from the worst parts.

      • aesthelete@lemmy.world
        link
        fedilink
        English
        arrow-up
        14
        ·
        edit-2
        1 day ago

        It reminds me of the quote, “if I had more time I would have written you a shorter letter”. Terse code is often better, because it is often developed using a process that only adds necessary things or was created by trial and error during the development process that isn’t included in the final output.

        Lengthy code is often written because a person coded their misunderstandings, their ambiguities about the problem space, and their early failures at solving the problem into the code.

          • AA5B@lemmy.world
            link
            fedilink
            English
            arrow-up
            2
            ·
            23 hours ago

            Complexity or “complexity”? A couple months ago I had to accept a merge from a junior developer that is now flagged as the code with the highest complexity in my code base. It was in Groovy and he must have just discovered closures. Instead of breaking up the code in nice modular testable blocks, it was massive methods hundreds of lines long, and the most egregious use of closures

            • magic_lobster_party@fedia.io
              link
              fedilink
              arrow-up
              1
              ·
              23 hours ago

              Not necessarily closures, but it involved many dynamically generated lists of lambdas passed around through many layers of abstraction.

      • AA5B@lemmy.world
        link
        fedilink
        English
        arrow-up
        2
        ·
        24 hours ago

        Fun story time: I did that in high school. My best friend at the time (and still) and I were in several of the same classes and would do homework together. We’d work out the answers, then write down the “same” ones. But he would always embellish, be much wordier. He got so pissed when I consistently got better grades by writing the same answers but more concisely