• ColdFenix@discuss.tchncs.de
    link
    fedilink
    arrow-up
    15
    arrow-down
    1
    ·
    7 months ago

    The trick is to split the code into smaller parts.

    This is how I code using ChatGPT:

    1. Have it analyze how to structure the program and then give me the code for the outline with not yet implemented methods and functions.
    2. Have it implement the methods and functions one by one with tests for each one.
    3. I copy the code and test for each method and function before moving on to the next one So that I always have working code.
    4. Despair because my code is working and I have no idea how it works and I have become a machine that just copies code without an original thought of my own.

    This works pretty well for me as long as I don’t work with obscure frameworks or in large codebases.

  • Hazzia@discuss.tchncs.de
    link
    fedilink
    arrow-up
    5
    ·
    7 months ago

    Saw an article on getpocket while at work by an alleged programmer that was “mourning the art of coding” because ChatGPT was doing such a good job that his non-coder friend was able to setup a webpage.

    To be fair I couldn’t tollerate reading past the first paragraph, but it definitely felt like the dude didn’t know the difference between funtional code and good code. Like, sure ChatGPT may be able to make a website, but good luck getting it to formulate anything non-generic.

    • Platypus@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      3
      ·
      7 months ago

      I read that one, he literally described himself as mediocre programmer and is excited about gpt as a way for mediocre programmers to be competitive again. I’m sure he’s in for a really fun time when he has to find a bug in 12k lines of AI spaghetti he bolted together.

      • Hazzia@discuss.tchncs.de
        link
        fedilink
        arrow-up
        0
        ·
        7 months ago

        Ahhh that certainly makes more sense. But now I’m kinda pissed at him for acting like some authority in the field up front to say “oh no ChatGPT is just so good” just to then admit that he’s closer to the non-programmer side of the scale, but that may just be my residual rage from trying to stomach that article bleeding through.

  • stebo02@sopuli.xyz
    link
    fedilink
    arrow-up
    2
    ·
    7 months ago

    I never copy code from chatgpt. It’s not my code and it probably doesn’t work. However it is great at making suggestions on how to tackle a problem or how to improve your code. Use ChatGPT like Stack Overflow, with instant replies.

    • Railcar8095@lemm.ee
      link
      fedilink
      arrow-up
      2
      ·
      7 months ago

      This. I always use that example, ChatGPT is stack overflow or a very eager intern. Review and make test cases

    • Lucidlethargy@sh.itjust.works
      link
      fedilink
      arrow-up
      0
      arrow-down
      1
      ·
      7 months ago

      Man, it’s great until it contently feeds you incorrect information. I’ve been burned far too many times at this point…

      • stebo02@sopuli.xyz
        link
        fedilink
        arrow-up
        2
        ·
        7 months ago

        That’s why you should always verify the information with other sources. Just like information you get from any other website/person. It’s not any different.

  • LesserAbe@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    7 months ago

    I just use it for snippets - “here’s my function, how would I go about changing x?” Or, “here’s my block of code, I’m getting this error, what am I missing?” (I know, I’m fine to share my code but not company code)

    • SomeBoyo@feddit.de
      link
      fedilink
      arrow-up
      0
      ·
      7 months ago

      You can host a model locally with gpt4all. So using company code shouldn’t be a problem, since it wouldn’t leave your machine.