5 ms·
I use it when I think it would have enough context in the current code to write a new function/class etc, and then defining it in a plain English comment: // f
by cloudking 3y ago
I use it when I think it would have enough context in the current code to write a new function/class etc, and then defining it in a plain English comment:
// function that does XYZ
Hit enter, see the function suggestion and hit tab to accept it if it looks good. Sometimes I will reference specific variables or methods I want to it to use, again in the code comment. Which is much faster than writing the code block from scratch.
I also accept small autocompletes from it when I'm writing the code myself, it seems like a more powerful autocomplete in general.
- dpflan 3y agoDo you try things like make a set of unit tests and then have the LLM create methods that the tests test? It seems that there needs to be tight coupling and verification between what is generated and whether it actually accomplishes the task, and tests can guide this.
- cloudking 3y agoI haven't gone too much into testing code, but I'm sure it could look at your code and generate the entire unit test for you. I would just write it out as a comment again: // Write a unit test for method xyz
- dpflan 3y agoIm suggesting the unit tests come first, are made by the coder (maybe with assistance), and the LLM creates the feature code. And the unit tests prove the generated code works or not then you tweak. Like TDD meets LLM