• Mr_Lobster@lemm.ee
    link
    fedilink
    English
    arrow-up
    23
    arrow-down
    1
    ·
    1 year ago

    I literally cannot comprehend coding with ChatGPT- How can I expect something to work if I don’t understand it, and how can I understand it if I don’t code and debug it myself? How can you expect to troubleshoot any issues afterwards if you don’t understand the code? I wouldn’t trust GPT for anything more complex than Hello World.

    • mild_deviation@programming.dev
      link
      fedilink
      arrow-up
      13
      arrow-down
      1
      ·
      1 year ago

      Just yesterday, I wrote a first version of a fairly complex method, then pasted it into GPT-4. It explained my code to me clearly, I was able to have a conversation with it about the code, and when I asked it to write a better version, that version ended up having a couple significant logical simplifications. (And a silly defect that I corrected it on.)

      The damn thing hallucinates sometimes (especially with more obscure/deep topics) and occasionally makes stupid mistakes, so it keeps you on your toes a bit, but it is nevertheless a very valuable tool.

      • philm@programming.dev
        link
        fedilink
        arrow-up
        8
        ·
        1 year ago

        That only really works, if the method is self-contained, and written in a language that GPT has seen often (such as python). I stopped using it, because for 1 in 10 successful tries I waste time for the other 9 tries…

    • worldsayshi@lemmy.world
      link
      fedilink
      arrow-up
      12
      arrow-down
      1
      ·
      edit-2
      1 year ago

      You shouldn’t use code that you don’t understand. Chatgpt outputs quite readable and understandable code and makes sure to explain a lot of it and you can ask questions about it.

      It can save quite a lot of effort, especially for tasks that are more tedious than hard. Even more if you have a general idea of what you want to do but you’re not familiar with the specific tools and libraries that you want to use for the task.

      • III@lemmy.world
        link
        fedilink
        English
        arrow-up
        11
        arrow-down
        1
        ·
        1 year ago

        It’s also wrong a lot. Hence the requirement for understanding. It can be helpful to get through a stretch but it will fuck up before too long and relying on it entirely is a bad idea.

    • Psythik@lemm.ee
      link
      fedilink
      arrow-up
      7
      arrow-down
      3
      ·
      1 year ago

      I haven’t been in web development in over 20 years; thanks to ChatGPT, I was able to get up-to-speed and start building websites again, when in the past I would have never been able to do so.

      GPT is a powerful tool that can allow anyone to do anything if they’re willing to put in the effort. We should be praising it, not making fun of it. It’s as revolutionary as the internet itself.

    • philm@programming.dev
      link
      fedilink
      arrow-up
      4
      ·
      1 year ago

      This.

      If I’m writing something slightly more complex, ChatGPT(4) is mostly failing.

      If I’m writing complex code, I don’t even get the idea of using ChatGPT, because I’m only getting disappointed, and in the end waste more time trying to “engineer” the prompt, only to get disappointed again.

      I currently cannot imagine using ChatGPT for coding, I was excited in the beginning, and it’s sometimes useful, but mostly not really for coding…

      • worldsayshi@lemmy.world
        link
        fedilink
        arrow-up
        3
        ·
        1 year ago

        If you’re already knee deep in existing code and looking for bugs or need to write quite specific algorithms it seems not very useful. But if you for some reason need to write stuff that has the slightest feeling of boilerplate, like how do I interact with well established framework or service X while doing A, B C it can be really useful.

        • oldfart@lemm.ee
          link
          fedilink
          arrow-up
          2
          ·
          1 year ago

          Also it’s often doing a great job if you paste a stack trace into it and maybe some surrounding code. I used it to fix someone else’s Java code as well as to upgrade some 3rd party Wordpress junk to latest PHP. I barely know Java and stopped following PHP news around version 5.6.

    • 1984@lemmy.today
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      1 year ago

      Often the code is self explanitory. I understand the code very often, but I still couldn’t write it correctly from scratch. You never feel like that?

      This is how code examples in books works too. You get some code to look at and try to understand it. Otherwise it’s like you would ignore code examples while learning programming.

    • corsicanguppy@lemmy.ca
      link
      fedilink
      arrow-up
      2
      arrow-down
      1
      ·
      1 year ago

      I use it to give me prototypes for ansible because Ansible is junk. Then I build my stuff from the mishmash and have GPT check it. Cuts a lot of time down that I’d rather be doing any-bloody-thing else with.