• chaosCruiser@futurology.today
    link
    fedilink
    English
    arrow-up
    0
    ·
    18 days ago

    Here’s a bit of code that’s supposed to do stuff. I got this error message. Any ideas what could cause this error and how to fix it? Also, add this new feature to the code.

    Works reasonably well as long as you have some idea how to write the code yourself. GPT can do it in a few seconds, debugging it would take like 5-10 minutes, but that’s still faster than my best. Besides, GPT also fairly fluent in many functions I have never used before. My approach would be clunky and convoluted, while the code generated by GPT is a lot shorter.

    • Windex007@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      18 days ago

      That makes sense as long as you’re not writing code that needs to know how to do something as complex as …checks original post… count.

      • TimeSquirrel@kbin.melroy.org
        link
        fedilink
        arrow-up
        0
        ·
        18 days ago

        It can do that just fine, because it has seen enough examples of working code. It can’t directly count correctly, sure, but it can write “i++;”, incrementing a variable by one in a loop and returning the result. The computer running the generated program is going to be doing the counting.