• 46 Posts
  • 1.4K Comments
Joined 3 years ago
cake
Cake day: January 29th, 2024

help-circle


  • I maintain several small open source projects. I sometimes use AI for my own PRs, especially ones that are almost mechanical but not quite. A great use for AI is “fix the new listing issues from this litter update.”

    I’ve been getting a moderate amount of AI slop PRs recently, though it has also coincided with a similar increase in PRs that are probably written by (or an least partially written by) AI but are actually useful. The ones I’d call “AI slop” tend to be huge, change a lot of tests, and may or may not even achieve their goal. A recent AI-written PR I got from an external first-time contributor fixed a bug by refactoring some code into a function, ending up with 4 calls to that function, of which 3 of the previous implementations had been correct and one had missed a step back in 2021. Net code added? 1 line, and only because it added a test.

    The main problem is how much time I end up spending on these slop PRs. It can take a while to even describe why you’re rejecting the change, though ironically AI has made this easier too.



  • lengau@midwest.socialtoLinux@programming.dev•Yea...
    link
    fedilink
    arrow-up
    5
    arrow-down
    1
    ·
    22 days ago

    Presies.

    Having an AI help you code is like getting your six-year-old to help you put a shelf on the wall. Undirected, they’re just going to make a huge mess for you to clean up later. Given specific tasks within their abilities, they can actually make it both go faster and be an altogether more pleasant experience.

    With direction and an operator who knows its limits, AI can be used to semi-automate many boring tasks. One of the things I’ve got set up in some of my open source projects is an LLM that takes bug reports and turns them into regression tests. I don’t always end up committing the AI-generated test (sometimes it’s very slow and I can better pinpoint the behaviour and target a test at that), but it helps because I don’t have to do that scaffolding myself, and I can just immediately jump into a debugger.





  • Ive done a few of those, but they were all preparatory refractors, pulling out bits of code to turn them into standalone functions that are only used once because my next PR uses them, and then adding unit tests for those new functions. -100 or so lines of code, +300 or so when you take into account the new docstrings, etc.

    (The secret to doing these preparatory refractors is to actually do them after writing the “next” PR so you’re not unnecessarily refactoring stuff you’re going to touch.)