• ColdFenix@discuss.tchncs.de
    link
    fedilink
    arrow-up
    6
    ·
    10 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.

  • stebo02@sopuli.xyz
    link
    fedilink
    arrow-up
    1
    ·
    10 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.

  • LesserAbe@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    10 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
      ·
      10 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.