• Daxtron2@startrek.website
    link
    fedilink
    arrow-up
    56
    ·
    edit-2
    6 months ago

    I think this is extremely important:

    Furthermore, we find that participants who trusted the AI less and engaged more with the language and format of their prompts (e.g. re-phrasing, adjusting temperature) provided code with fewer security vulnerabilities.

    Bad programmers + AI = bad code

    Good programmers + AI = good code

      • Aurenkin@sh.itjust.works
        link
        fedilink
        arrow-up
        5
        ·
        6 months ago

        What do you mean? Sounds to me like any other tool, it takes skill to use it well. Same as stack overflow, built in code suggestions or IDE generated code.

        Not to detract from the usefulness of it just in terms of the fact that it requires knowledge to use well.

        • ericjmorey@programming.devOP
          link
          fedilink
          arrow-up
          3
          arrow-down
          2
          ·
          6 months ago

          As someone currently studying machine learning thoery and how these models are built, I’m explaining that built into the models at their core are functions that amplify the bias of the training data by identifying and using mathematical associations within the training data to create output. Because of that design, a naive approach to its use would result in amplified bias of not only the training data but also the person using the tool.

    • abhibeckert@lemmy.world
      link
      fedilink
      arrow-up
      12
      ·
      edit-2
      6 months ago

      This. As an experienced developer I’ve released enough bugs to miss-trust my own work and spend as much time as I can afford in the budget on my own personal QA process. So it’s no burden at all to have to do that with AI code. And of course, a well structured company has further QA outside of that.

      If anything, I find it easier to do that with code I didn’t write myself. Just yesterday I merged a commit with a ridiculous mistake that I should have seen. A colleague noticed it instantly when I was stuck and frustrated enough to reach out for a second opinion. I probably would’ve noticed if an AI had written it.

      Also - in hindsight - an AI code audit would have also picked it up.

      • Tobias Hunger@programming.dev
        link
        fedilink
        arrow-up
        2
        ·
        6 months ago

        The quote above covered exactly what you just said: “yet were also more likely to rate their insecure answers as secure compared to those in our control group” at work :-)

      • Daxtron2@startrek.website
        link
        fedilink
        arrow-up
        2
        arrow-down
        6
        ·
        6 months ago

        I find that the people who complain the most about AI code aren’t professional programmers. Everyone at my company and my friends who are in the industry are all very positive towards it

      • Daxtron2@startrek.website
        link
        fedilink
        arrow-up
        6
        arrow-down
        2
        ·
        6 months ago

        eh, I’ve known lots of good programmers who are super stuck in their ways. Teaching them to effectively use an LLM can help break you out of the mindset that there’s only one way to do things.

        • floofloof@lemmy.ca
          link
          fedilink
          English
          arrow-up
          7
          ·
          edit-2
          6 months ago

          I find it’s useful when writing new code because it can give you a quick first draft of each function, but most of the time I’m modifying existing applications and it’s less useful for that. And you still need to be able to judge for yourself whether the code it offers is any good.

            • pkill@programming.dev
              link
              fedilink
              arrow-up
              1
              ·
              edit-2
              6 months ago

              It really depends

              1. How widely used is the thing you want to use. For example it hallucinated caddyfile keys when I asked it about setting up early data support for a reverse proxy to a docker container, luckily caddy docs are really good and it was an issue with the framework I use anyway so I had to look it up myself after all. Ig it’d have been more likely to do this right at first attempt if say I wanted it to achieve that using Express with Nginx. For even less popular technology like Elixir it’s borderline useless beyond very high level concepts than can apply to any programming language.
              2. How well documented it is, also more widespread use can sometimes make up for bad docs.
              3. How much has changed since it was trained. Also it might still include deprecated methods since it doesn’t discriminate between official docs and other sources like SO in it’s training data.

              If you want to avoid these issues I’d suggest to first read the docs, then look up stack overflow or likely name of a function you need to write on grep.app, then use a LLM as your last resort. Good for prototyping usually, less so for more specific things.