- May 2, 2010
- 9,937
- 16,038
If you are tired of chatgpt mixing up all kinds of things in your code there is a simple solution.
TDD.
Test driven development.
Its where you write tests and your code in conjunction with each other. Then you can run tests in your ide, and see green tick boxes, for every pass, and a failure log and notice for ones that don't.
I got chatgpt to write me an analysing function to test my functions for esmodule and common js (I want only commonjs) and now when I run the tests first, I can see if the file is being recognised by the function, and is valid. (if it hallucinates the wrong code, and I don't notice, I detect it early.)
Have a go at using tests if you don't already, I think there are some ideas that will even write them from your code. They are essential to keeping your development time to a minimum.
TDD.
Test driven development.
Its where you write tests and your code in conjunction with each other. Then you can run tests in your ide, and see green tick boxes, for every pass, and a failure log and notice for ones that don't.
I got chatgpt to write me an analysing function to test my functions for esmodule and common js (I want only commonjs) and now when I run the tests first, I can see if the file is being recognised by the function, and is valid. (if it hallucinates the wrong code, and I don't notice, I detect it early.)
Have a go at using tests if you don't already, I think there are some ideas that will even write them from your code. They are essential to keeping your development time to a minimum.