• BJW@lemmus.org
    link
    fedilink
    English
    arrow-up
    2
    ·
    19 hours ago

    That is a pitfall that is difficult to mitigate. When using these models your own code base is the primary input, and it will match the style. Garbage in, garbage out. It may be worthwhile to refactor prior using a model. Even having intelligible method and variable names can make a difference. Maybe do a sweep of simple renaming, and adding supplemental explanatory comments, then you might get better results?

    • themaninblack@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      16 hours ago

      Yours is a good point. I know that the guy who solo-created Redis uses AI effectively to write tests - he gives it a lot of handwritten tests and a lot of context, and then asks it to match the style and pattern, which it does well.

      I’ve got something like half a million to a million lines, a crazy level of cyclomatic complexity, and a team that doesn’t see a problem with it. That’s the tough part - socialising the changes. We tend to arbitrarily rename vars/methods and not keep things in the same place, so there is a lot of drift.

      I think AI might be able to unpack some of that, but there is a sort of irreducible accidental complexity that would require a human to make decisions about what some things mean. In some cases, you could get a gaggle of devs in the same room and they would not be able to arrive at a decision about what the code is doing or even what it should be doing.