• Seems I spent more time fixing it compared to thinking it myself

      AI code is just bad code written by someone else that I now have to fix, and we all know the one job every coder loves is fixing code written by someone who you cannot ask: “why did you do it this way?”

        • FaceDeer ( FaceDeer@kbin.social ) 
          link
          fedilink
          arrow-up
          5
          ·
          3 years ago

          I recall reading a while back of one person’s strategy, whenever ChatGPT generates code for him he immediately tells ChatGPT “there’s a bug in that code” (without checking or specifying). It’ll often find one.

          Another approach I’ve heard of is to tell ChatGPT that it’s supposed to roleplay two roles when generating code, a programmer and a code reviewer. The code reviewer tidies up the initial code and fixes bugs.

          Since often ChatGPT’s code works fine for me I don’t usually bother with these steps initially, since I’m usually just wanting a quick and dirty script for a one-off task the quality doesn’t matter much in my case.

          • jcg ( jcg@halubilo.social ) 
            link
            fedilink
            arrow-up
            3
            ·
            3 years ago

            And you know what you call changing words around to get a computer to do what you want? That’s programming, baby! We are programming programmers!

      • philm ( philm@programming.dev ) 
        link
        fedilink
        arrow-up
        4
        ·
        3 years ago

        Yeah, this is the way how to interact with it. It makes sense as well, because it’s only predicting the next word based on the previous words, so it had can in hindsight find a lot more stuff and in general be smarter about it.