this post was submitted on 06 Dec 2023
713 points (96.8% liked)

Programmer Humor

32472 readers
954 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 

cross-posted from: https://fed.dyne.org/post/43780

you are viewing a single comment's thread
view the rest of the comments
[โ€“] [email protected] 79 points 11 months ago (10 children)

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.

[โ€“] [email protected] 20 points 11 months ago

Actually, that's the trick when writing code in general, and also how unit tests help coding an application.

load more comments (9 replies)