• Tiefling IRL@lemmy.blahaj.zone
    link
    fedilink
    arrow-up
    10
    arrow-down
    3
    ·
    edit-2
    5 months ago

    Stuff like this is really useful when variable names are annoying, or when you have to repeat the same monotonous pattern over a large batch of code.

    My favorite use of AI in code so far has been refactoring deprecated feature flags. “Replace enableXYZFeatureFlag with true and optimize the code”. Bam, 1-2 hours’ worth of crunch work solved in minutes.

    • Kache@lemm.ee
      link
      fedilink
      arrow-up
      11
      arrow-down
      2
      ·
      5 months ago

      If it takes 1+ hours of work to remove a feature flag branch in an area of code, I wouldn’t trust the correctness of anything the AI writes and would be super skeptical about anything the humans had written.

      • Tiefling IRL@lemmy.blahaj.zone
        link
        fedilink
        arrow-up
        6
        ·
        edit-2
        5 months ago

        It takes a long time because it hits a lot of files, not because it’s logically complex. Also, that’s why unit and integration tests exist.