- ColdFenix ( @ColdFenix@discuss.tchncs.de ) 45•11 months ago
The trick is to split the code into smaller parts.
This is how I code using ChatGPT:
- Have it analyze how to structure the program and then give me the code for the outline with not yet implemented methods and functions.
- Have it implement the methods and functions one by one with tests for each one.
- 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.
- 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.
- DeathsEmbrace ( @DeathsEmbrace@lemmy.ml ) 13•11 months ago
This is exactly how you forget coding.
- averyminya ( @averyminya@beehaw.org ) 2•11 months ago
You’d search it anyway.
- HurlingDurling ( @HurlingDurling@lemm.ee ) English13•11 months ago
Actually, that’s the trick when writing code in general, and also how unit tests help coding an application.
- Tathas ( @Tathas@programming.dev ) 6•11 months ago
To be fair, you’re also describing working with other people.
- stebo02 ( @stebo02@sopuli.xyz ) 27•11 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 ( @Railcar8095@lemm.ee ) 13•11 months ago
This. I always use that example, ChatGPT is stack overflow or a very eager intern. Review and make test cases
- tweeks ( @tweeks@feddit.nl ) 4•11 months ago
Plain copy paste without a critical view is not recommended, but it surely provides good pieces of code from time to time. Especially in obscure frameworks/languages, compared to what can be googled.
ChatGPT 4 is a really big difference with 3.5 though. What took me hours together with the 3.5, was fixed in a few minutes with 4.
- Empathy [he/him] ( @Empathy@beehaw.org ) 16•11 months ago
Co-pilot can write some small very simple functions for me, sometimes saving me the need to look at documentation. It will still often fail at those, in my experience, and will consistently fail at anything more complex.
It will get better, but currently it’s only a small help.
- voxel ( @vox@sopuli.xyz ) 4•11 months ago
it really helps with the boring parts and takss that require doing the same thing over and over;
for example, i use it to generate mapping functions (like in my (abandoned) gba emulator project, function that maps arm instruction type enum to function pointers was generated almost entirely by chatgpt)
- Aabbcc ( @Aabbcc@lemm.ee ) 7•11 months ago
I’ve been having a great time with copilot
- CanadaPlus ( @CanadaPlus@lemmy.sdf.org ) 3•11 months ago
Yeah, that’s the way to go. Copilot or similar to automate the simple stuff, while you still do all the architecting and check whatever it suggests.