• Pennomi@lemmy.world
      link
      fedilink
      English
      arrow-up
      37
      arrow-down
      9
      ·
      edit-2
      3 days ago

      Uh yeah, like all the time. Anyone who says otherwise really hasn’t tried recently. I know it’s a meme that AI can’t code (and still in many cases that’s true, eg. I don’t have the AI do anything with OpenCV or complex math) but it’s very routine these days for common use cases like web development.

      • Maalus@lemmy.world
        link
        fedilink
        arrow-up
        15
        arrow-down
        1
        ·
        3 days ago

        I recently tried it for scripting simple things in python for a game. Yaknow, change char’s color if they are targetted. It output a shitton of word salad and code about my specific use case in the specific scripting jargon for the game.

        It all based on “Misc.changeHue(player)”. A function that doesn’t exist and never has, because the game is unable to color other mobs / players like that for scripting.

        Anything I tried with AI ends up the same way. Broken code in 10 lines of a script, halucinations and bullshit spewed as the absolute truth. Anything out of the ordinary is met with “yes this can totally be done, this is how” and “how” doesn’t work, and after sifting forums / asking devs you find out “sadly that’s impossible” or “we dont actually use cpython so libraries don’t work like that” etc.

        • Sl00k@programming.dev
          link
          fedilink
          English
          arrow-up
          1
          arrow-down
          1
          ·
          1 day ago

          It’s possible the library you’re using doesn’t have enough training data attached to it.

          I use AI with python for hundreds line data engineering tasks and it nails it frequently.

        • Pennomi@lemmy.world
          link
          fedilink
          English
          arrow-up
          6
          arrow-down
          11
          ·
          3 days ago

          Well yeah, it’s working from an incomplete knowledge of the code base. If you asked a human to do the same they would struggle.

          LLMs work only if they can fit the whole context into their memory, and that means working only in highly limited environments.

          • Maalus@lemmy.world
            link
            fedilink
            arrow-up
            13
            arrow-down
            1
            ·
            3 days ago

            No, a human would just find an API that is publically available. And the fact that it knew the static class “Misc” means it knows the api. It just halucinated and responded with bullcrap. The entire concept can be summarized with “I want to color a player’s model in GAME using python and SCRIPTING ENGINE”.

        • Pennomi@lemmy.world
          link
          fedilink
          English
          arrow-up
          7
          arrow-down
          2
          ·
          3 days ago

          Not sure what you mean, boilerplate code is one of the things AI is good at.

          Take a straightforward Django project for example. Given a models.py file, AI can easily write the corresponding admin file, or a RESTful API file. That’s generally just tedious boilerplate work that requires no decision making - perfect for an AI.

          More than that and you are probably babysitting the AI so hard that it is faster to just write it yourself.

      • GreenMartian@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        9
        ·
        3 days ago

        They have been pretty good on popular technologies like python & web development.

        I tried to do Kotlin for Android, and they kept tripping over themselves; it’s hilarious and frustrating at the same time.

        • doktormerlin@feddit.org
          link
          fedilink
          arrow-up
          5
          arrow-down
          1
          ·
          3 days ago

          I use ChatGPT for Go programming all the time and it rarely has problems, I think Go is more niche than Kotlin

          • Opisek@lemmy.world
            link
            fedilink
            arrow-up
            2
            ·
            3 days ago

            I get a bit frustrated at it trying to replicate everyone else’s code in my code base. Once my project became large enough, I felt it necessary to implement my own error handling instead of go’s standard, which was not sufficient for me anymore. Copilot will respect that for a while, until I switch to a different file. At that point it will try to force standard go errors everywhere.

            • doktormerlin@feddit.org
              link
              fedilink
              arrow-up
              1
              ·
              2 days ago

              Yes, you can’t use Copilot to generate files in your code structure way if you start from scratch. I usually start by coding a skaffold and then use Copilot to complete the rest, which works quite good most of the time. Another possibility is to create comment templates that will give instructions to Copilot. So every new Go file starts with coding structure comments and Copilot will respect that. Junior Devs might also respect that, but I am not so sure about them

      • wischi@programming.dev
        link
        fedilink
        arrow-up
        9
        arrow-down
        3
        ·
        3 days ago

        Play ASCII tic tac toe against 4o a few times. A model that can’t even draw a tic tac toe game consistently shouldn’t write production code.

      • Boomkop3@reddthat.com
        link
        fedilink
        arrow-up
        8
        arrow-down
        3
        ·
        edit-2
        18 hours ago

        I tried, it can’t get trough four lines without messing up. Unless I give it tasks that are so stupendously simple that I’m faster typing them myself while watching tv

        • Sl00k@programming.dev
          link
          fedilink
          English
          arrow-up
          1
          ·
          1 day ago

          Four lines? Let’s have realistic discussions, you’re just intentionally arguing in bad faith or extremely bad at prompting AI.

          • Boomkop3@reddthat.com
            link
            fedilink
            arrow-up
            1
            ·
            18 hours ago

            You can prove your point easily: show us a prompt that gives us a decent amount of code that isn’t stupidly simple or sufficiently common that I don’t just copy paste the first google result

            • Sl00k@programming.dev
              link
              fedilink
              English
              arrow-up
              1
              ·
              8 hours ago

              I have nothing to prove to you if you wish to keep doing everything by hand that’s fine.

              But there are plenty of engineers l3 and beyond including myself using this to lighten their workload daily and acting like that isn’t the case is just arguing in bad faith or you don’t work in the industry.

              • Boomkop3@reddthat.com
                link
                fedilink
                arrow-up
                1
                ·
                7 hours ago

                I do use it, it’s handy for some sloppy css for example. Emphasis on sloppy. I was kinda hoping you actually had something there