• TomMasz@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    6 days 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.

    • bollybing@lemmynsfw.com
      link
      fedilink
      English
      arrow-up
      0
      ·
      6 days ago

      Takes me back to highscool assignments where a few very keen people would submit like 100 page projects and then ask how long mine was and I’d say 13 pages. They’d look all smug and make comments about how I wouldn’t get a good mark but guess what: I covered all the points in the marking scheme with sufficent detail, while they rambled off topic and repeated themselves. Nobody wants to read in ten pages something that can be adequetely described in one.

      • AA5B@lemmy.world
        link
        fedilink
        English
        arrow-up
        0
        ·
        5 days 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

    • magic_lobster_party@fedia.io
      link
      fedilink
      arrow-up
      0
      ·
      6 days 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
        0
        ·
        6 days 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
            0
            ·
            5 days 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

    • Flamekebab@piefed.social
      link
      fedilink
      English
      arrow-up
      0
      ·
      6 days 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
        0
        ·
        5 days 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
          0
          ·
          4 days 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
          0
          ·
          5 days 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
          0
          ·
          5 days 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…